No description
Find a file
2026-08-05 11:49:10 +01:00
rasql-build Write working prototype for rasql-build 2026-08-05 10:49:22 +01:00
rasql-core Fix db_aliases for types 2026-08-05 11:49:10 +01:00
rasql-model Add function for generating type definitions for tables 2026-08-02 12:14:55 +01:00
rasql-query Set versions to 0.0.0, add license and description to Cargo.toml 2025-01-27 00:40:19 +00:00
rasql-traits Add function for generating type definitions for tables 2026-08-02 12:14:55 +01:00
.gitignore Initial workspace 2024-03-24 11:30:19 +00:00
Cargo.lock Write working prototype for rasql-build 2026-08-05 10:49:22 +01:00
Cargo.toml Wrote SimpleDataType for use with type overrides 2026-08-05 10:44:31 +01:00
README.md Mention rasql-traits in the readme 2025-01-27 00:20:16 +00:00

Rasql

Statically analyse SQL schemas and queries to generate Rust type definitions.

Rasql doesn't require you to define your schema and queries in its own syntax like an ORM might. Instead you write in the most mature language for defining and querying databases, SQL. Rasql statically analyses your SQL, type checking as it goes, and emits compatible Rust types to prevent runtime errors like this:

cannot convert between the Rust type `i32` and the Postgres type `int8`

By writing in SQL, Rasql doesn't lock you in to using Rust for all of your database access. If another language you work in has a similar type generator, it and Rasql can happily coexist without even needing to know the other is there.

rasql-core

rasql-core holds the entire static analysis engine as well as the type generator. If you're looking to extend this project, or just track down a bug, this is where you should probably look. If you just want to use this project, look at the other crates in this repo.

rasql-build

rasql-build provides an API designed to be used from a build script. If you have a crate that you would like to hold type definitions, you can use this from your crate's build script to achieve it.

rasql-query

rasql-query provides procedural macros so you can write fully type-checked queries with automatically typed row output to prevent runtime type errors. This depends on you already using rasql-build.

rasql-traits

rasql-traits provides trait definitions for various database operations and types. The types that rasql-core generates implement these traits depending on the generation config.

Acknowledgements

Rasql builds upon the work of the sqlparser-rs team, without which this project would not exist.