NyxCode / ormx

bringing orm-like features to sqlx
MIT License
287 stars 32 forks source link

Upgrade sqlx from 0.6 to 0.7 #37

Closed pymongo closed 5 days ago

pymongo commented 10 months ago

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>>;
 }
NyxCode commented 5 days ago

Working on it, finally. (#40)