-
|
Sorry for raising an issue - "discussions" are not enabled. I have some questions:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi!
For Select builder you can use the order_by in any database. If you need this statement in SQLite right now you can use the builder.raw_after. Ex: // SQLite alternative
let query = sql::Delete::new()
.delete_from("users")
.where_clause("name = 'foo'")
.raw_after(sql::DeleteClause::Where, "order by user_id")
.as_string();
As said in the session How it's works all parameter are
You can use parameter placeholder like: // Postgres syntax
fn query_find_user_by_login(id: &str) -> (String, Vec<String>) {
let query = sql::Select::new()
.select("*")
.from("users")
.where_clause("login = $1::varchar") // $1 is the login placeholder
.as_string();
let params = vec![login];
(query, params)
}
// ...
let (query, params) = query_find_user_by_login("foo");
db.query(&query, ¶ms).await? |
Beta Was this translation helpful? Give feedback.
Hi!
For Select builder you can use the order_by in any database.
For Update and Delete builders, Postgres do not support this statement, SQLite supports but I not prioritize this feature at that time, eventually this feature will be added to the lib.
If you need this statement in SQLite right now you can use the builder.raw_after. Ex:
As said in the ses…