typed-sql
typed-sql copied to clipboard
Support multiple fields using Queryable trait
Is not possible use multiple fields using Queryable trait in a struct.
#[derive(Table)]
struct Task {
id: u64,
description: String,
is_done: bool,
}
#[derive(Queryable)]
struct TaskQuery {
description: String,
is_done: bool,
}
let mounted_query = Task::table().query(TaskQuery::queryable()).to_sql();
Instead of the wildcard (*) be: SELECT * FROM tasks;
, is possible to define the fields in the final query?
Example: SELECT description, is_done FROM tasks;
Excellent approach of this lib, following the concept 'Security by design'. Thanks.