Here is the requested code (it's short so I included the whole thing). It doesn't specify any explicit lifetimes. Does that answer the lifetime question?
293 /// Like jdbc's default, if you don't call begin/rollback/commit, sqlx will commit after every
294 /// sql statement, but if you call begin/rollback/commit, it will let you manage
295 /// explicitly and will automatically turn autocommit on/off as needed to allow that. (???)
296 fn begin_trans(&self) -> Result<Transaction<Postgres>, anyhow::Error> {
297 let tx: Transaction<Postgres> = match self.rt.block_on(self.pool.begin()) {
298 Err(e) => return Err(anyhow!(e.to_string())),
299 Ok(t) => t, 300 };
301 // %% see comments in fn connect() re this AND remove above method comment??
302 // connection.setAutoCommit(false); 303 Ok(tx)
304 }
I plan to look at your suggestion thoughtfully and note here the result; thank you.