Quaint is an abstraction over certain SQL databases. It provides:
- An AST for building dynamic SQL queries.
- Visitors for different databases to generate SQL strings.
- Connectors to abstract over results and querying.
- Pooling with mobc
- Async/await and Futures 0.3
mysql
: Support for MySQL databases.postgresql
: Support for PostgreSQL databases.sqlite
: Support for SQLite databases.mssql
: Support for Microsoft SQL Server databases.pooled
: A connection pool inpooled::Quaint
.json
: JSON type support withserde_json
crate.uuid
: UUID type support withuuid
crate.chrono
: DateTime type support withchrono
crate.serde-support
: Deserialize support from result set withserde
crate.tracing-log
: Logging withtracing
crate.bigdecimal
: Numeric values can be read asBigDecimal
.
- Query generation when the database and conditions are not known beforehand.
- Parameterized queries and SQL injection protection.
- A modular design, a separate AST and separate visitors and connectors.
- Database-level type-safety in query building or being an ORM.
For type-safe database abstraction, Diesel is an excellent choice.
- See
.envrc
for connection params. Override variables if different. MySQL, PostgreSQL and SQL Server needs to be running for tests to succeed.
Then:
> cargo test
The queries can be logged by setting the LOG_QUERIES
environment variable to any
value. They'll be logged at the INFO
level and are visible when having a
logger in scope. If using Tracing,
compiling Quaint with the tracing-log
feature flag will parameterize the
logged queries into a more suitable format for Tracing.
If you have a security issue to report, please contact us at security@prisma.io