typed-qb-0.2.0 doesn't have any documentation.
typed-qb
is a compile-time, typed, query builder.
The query is transformed into an SQL query string at compile time.
If code compiles and the schema in the code matches the database, it should be (almost) impossible to write queries that produce errors.
Make sure to enable the generic_associated_types
feature and include the prelude:
use *;
Use the tables macro to generate table definitions:
#
tables!
This will generate a table definition Users
implementing Table.
To construct queries, call the methods on this trait:
#
# use *;
let query = query;
# ground;
Pass the query to Database::typed_query to execute the query:
# use *;
# let query = query;
let opts = new
.user
.pass
.db_name;
let pool = new?;
let mut conn = pool.get_conn?;
let results = conn.typed_query?;
# Ok::