Git Product home page Git Product logo

quaint's Introduction

Quaint

crates.io docs.rs Cargo tests Discord

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

Documentation

Feature flags

  • 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 in pooled::Quaint.
  • json: JSON type support with serde_json crate.
  • uuid: UUID type support with uuid crate.
  • chrono: DateTime type support with chrono crate.
  • serde-support: Deserialize support from result set with serde crate.
  • bigdecimal: Numeric values can be read as BigDecimal.
  • vendored-openssl: Statically links against a vendored OpenSSL library on non-Windows or non-Apple platforms.

Goals:

  • 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.

Non-goals:

  • Database-level type-safety in query building or being an ORM.

For type-safe database abstraction, Diesel is an excellent choice.

Testing:

  • 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

Query debug

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.

Security

If you have a security issue to report, please contact us at [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.