ormx icon indicating copy to clipboard operation
ormx copied to clipboard

Upgrade sqlx from 0.6 to 0.7

Open pymongo opened this issue 2 years ago • 0 comments

I am trying to update sqlx to 0.7, but Insert trait let mut tx = db.begin().await?; db: impl Executor has no begin method on sqlx 0.7

         db: &mut <Db as Database>::Connection,
         row: impl Insert<Table = Self>,
     ) -> BoxFuture<Result<Self>> {
-        row.insert(db)
+        row.insert(&mut *db)
     }

     /// Insert a row into the database, returning the inserted row.
-    fn insert<'a, 'c: 'a>(
+    fn insert(
         self,
-        db: impl Executor<'c, Database = Db> + 'a,
-    ) -> BoxFuture<'a, Result<Self::Table>>;
+        db: &mut impl sqlx::Connection<Database = Db, Options=sqlx::mysql::MySqlConnectOptions>,
+    ) -> BoxFuture<Result<Self::Table>>;
 }

pymongo avatar Nov 03 '23 02:11 pymongo