Crates.io | rust-query |
lib.rs | rust-query |
version | 0.1.2 |
source | src |
created_at | 2024-05-06 12:51:23.979415 |
updated_at | 2024-05-07 12:12:54.952987 |
description | A query builder using rust concepts. |
homepage | |
repository | https://github.com/LHolten/rust-query/ |
max_upload_size | |
id | 1231122 |
size | 41,030 |
WIP means that it is probably not yet suitable for your project, but you can try it out and give me feedback.
The idea is to have a deep embedding, this means that we reuse rust concepts for queries:
Using the full expressiveness of the rust type system like this allows us to write queries that can not fail at runtime and get (nice) error messages.
This is a WIP project and thus has a number of limitations.
Despite these limitations, I am dogfooding this query builder and using it in my own project: advent-of-wasm.
schema::generate
in your build.rs
file to create bindings for your schema. (for an example see below),new_query
functions on either Client
or rusqlite::Connection
to start writing queries!First download the Chinook_Sqlite.sql
from here https://github.com/lerocha/chinook-database/releases and put it in the chinook
folder.
Then you can run with cd chinook
&& cargo run
There are some queries there that you can implement to test out the query builder.