typed-sql icon indicating copy to clipboard operation
typed-sql copied to clipboard

Support multiple fields using Queryable trait

Open JADSN opened this issue 3 years ago • 0 comments

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();

02

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.

JADSN avatar May 30 '21 11:05 JADSN