Comments (8)
hi, and thanks for looking into this! 👍
The current API for SQLx does a ping-pong between connection and transaction. When you begin a transaction, it takes ownership of the connection object. This makes writing an impl AsyncTransaction for sqlx::PgConnection very hard... it may only be possible with the current APIs/Traits to implement for a PgPool... then the migration system can grab a connection from the pool, and run through the whole process.
that is ok i think, mysql_async
support is only implemented for Pool
at the moment too.
regarding the other two issues, i'd rather wait for sqlx to update to 0.23, and the compiler bugs to be fixed, what do you think?
Meanwhile i am going to provide migrations from a config file instead of connection, so that we support usecases where the driver is not yet supported like this one
from refinery.
hi @JamesHinshelwood, have the issues mentioned by @belak on #57 (comment) been addressed?
from refinery.
libsqlite-sys has a version mismatch between rusqlite and sqlx. This can be resolved by migrating back to rusqlite 0.22 until sqlx has upgraded.
This is already resolved in latest SQLx master, however, there is a big release coming up which seems to change things fundamentally so it might be good to wait for 0.6 to be released.
from refinery.
At least for now, this is harder than you'd expect for multiple reasons:
- The current API for SQLx does a ping-pong between connection and transaction. When you begin a transaction, it takes ownership of the connection object. This makes writing an
impl AsyncTransaction for sqlx::PgConnection
very hard... it may only be possible with the current APIs/Traits to implement for a PgPool... then the migration system can grab a connection from the pool, and run through the whole process. - There are compiler bugs around
<Connection as HasRow>::Row vs PgRow
- it has issues inferring that they're the same thing. This can be worked around by using a macro with the concrete types to implement the same functionality everywhere. That may actually be better in the long term. The developer is working on some tweaks which may improve this soon. - libsqlite-sys has a version mismatch between rusqlite and sqlx. This can be resolved by migrating back to rusqlite 0.22 until sqlx has upgraded.
I may continue this later with Pool rather than the direct Connections if there's still interest.
from refinery.
I don't know how soon the compiler bugs will be fixed, but I think waiting for a new SQLx version to work around them would be good enough.
One other question: how would the API for this work? I've got the basic driver done but I'm not as sure about the other necessary changes. Since there would be multiple types which could provide migrations for the different database types it complicates things a bit.
from refinery.
I don't know how soon the compiler bugs will be fixed, but I think waiting for a new SQLx version to work around them would be good enough.
ok awesome 👍
One other question: how would the API for this work? I've got the basic driver done but I'm not as sure about the other necessary changes. Since there would be multiple types which could provide migrations for the different database types it complicates things a bit.
I am not sure, but what you are saying is that, through SQLx traits we can't have a unified API for all of their supported drivers?
from refinery.
Has anything changed on the status of this issue since these previous comments?
I'm happy to take a look at implementing something if there aren't any blockers..?
from refinery.
also, since sqlx
now also offers migration features, this might be redundant no?
from refinery.
Related Issues (20)
- Broken docker image 0.8.11 HOT 2
- Support mysql 24.0.0 HOT 3
- Support SurrealDB HOT 1
- Update broken Flyway documentation link HOT 1
- Support a function similar to flyway baseline HOT 1
- Wrap embedded migrations with enums HOT 8
- Get final database schema after all migrations are run HOT 3
- Current rusqlite version (0.30.0) not supported? HOT 1
- serde properties of Config should be under a feature gate along with Toml serde impl HOT 2
- New Files are not Detected by embed_migrations HOT 2
- Sqlx no longer supported because Migrate no longer implemented by Config HOT 3
- refinery_cli: ERROR: cannot insert multiple commands into a prepared statement HOT 7
- Add support for rusqlite 0.31.0 HOT 4
- refinery_cli: Error: `error applying update`, `db error: ERROR: relation "refinery_schema_history" does not exist` HOT 5
- Unreproducible release for refinery-core 0.8.13 HOT 2
- Changelog lists release 0.8.14 twice HOT 1
- Add run_iter_async HOT 2
- Build error with tiberius without serde HOT 2
- Allow specifying database schema on migrations (MSSQL database) HOT 1
- Missing math functions for SQLite HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refinery.