You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have access to the sqlx PoolConnection in the DatabaseTransaction struct for teams that combine raw sql and sea-orm. This would be similar to DatabaseConnection.get_postgres_connection_pool().
I know that sea-orm supports raw sql, but there are some features in sqlx that are quite useful, like compile time query checking that sea-orm doesn't support. Sqlx is also centered on sql, so with respect, it might be a bit more flexible and easy to use for sql.
This would make it very easy to use sea-orm and sqlx together in the whole stack, and it would help my team quite a lot.
I do realize that it might cause problems to expose the PoolConnection itself, in case someone e.g. commits the transaction outside of the sea-orm DatabaseTransaction. Perhaps there is a way to return the Executor trait from sqlx to mitigate this.
We'd be happy to contribute if the feedback on the idea is positive.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Idea
It would be nice to have access to the sqlx
PoolConnection
in theDatabaseTransaction
struct for teams that combine raw sql and sea-orm. This would be similar toDatabaseConnection.get_postgres_connection_pool()
.I know that sea-orm supports raw sql, but there are some features in sqlx that are quite useful, like compile time query checking that sea-orm doesn't support. Sqlx is also centered on sql, so with respect, it might be a bit more flexible and easy to use for sql.
This would make it very easy to use sea-orm and sqlx together in the whole stack, and it would help my team quite a lot.
I do realize that it might cause problems to expose the
PoolConnection
itself, in case someone e.g. commits the transaction outside of the sea-ormDatabaseTransaction
. Perhaps there is a way to return theExecutor
trait from sqlx to mitigate this.We'd be happy to contribute if the feedback on the idea is positive.
Beta Was this translation helpful? Give feedback.
All reactions