Introduction

Qusql is a collection of crates that make it quicker and easier to write correct, type-safe SQL in Rust and Python. MariaDB/MySQL and PostgreSQL are both first-class citizens.

The problem

SQL queries are usually just strings at compile time. Mistakes like wrong column names, wrong argument counts, and mismatched types only surface at runtime, often in production.

Qusql solves this by parsing your schema at compile time and checking every query against it before your binary is built.

Crates at a glance

CrateWhat it does
qusql-parseSQL lexer and parser; produces an AST
qusql-typeType-inference engine; checks queries against a schema
qusql-mysql-typeCompile-time typed MySQL/MariaDB queries in Rust (via qusql-mysql)
qusql-sqlx-typeCompile-time typed PostgreSQL queries in Rust (via sqlx)
qusql-py-mysql-typemypy-checked MySQL queries in Python

Source code

Everything lives in one repository: https://github.com/antialize/qusql

Each crate also has a worked example in the examples/ directory.