prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 61 forks source link

SQLx #138

Open pimeys opened 4 years ago

pimeys commented 4 years ago

While I've been considering our shift from separate SQL crates to SQLx, our recent move to a different runtime (async-std) adds another reason to consider it as the interface to the open source databases in Quaint.

What is SQLx?

Points to consider for using it:

Prisma is anyhow stuck now with old version of Tokio due to their latest runtime performing really bad with MySQL. QE is also now ran on top of async-std so we could benefit from the Tide HTTP server and to get Unix pipe and Windows named pipe support in the near future. Due to our database crates being based on Tokio, this means we still need an extra Tokio runtime for database actions, which adds to our memory usage and which might cause trouble in the future (more moving parts).

It also helps to have one of the async-std authors in the house (yay).

What would be the work items to get this done?

With the upcoming change to support SQL Server, and the upcoming change on Tiberius to be runtime-independent, we could then make Quaint to support both: Tokio and async-std with a feature flag (https://github.com/prisma/quaint/issues/152).

pimeys commented 4 years ago

One more point why this would make sense:

Errors would be the same. Now there are differences, such as not being able to execute queries without an error with SQLite if the queries return results. This works with my and pg, which is annoying when sqlite is not doing the same.