Struct grafbase_sql_ast::ast::Delete
source · pub struct Delete<'a> { /* private fields */ }
Expand description
A builder for a DELETE
statement.
Implementations§
source§impl<'a> Delete<'a>
impl<'a> Delete<'a>
sourcepub fn from_table<T>(table: T) -> Selfwhere
T: Into<Table<'a>>,
pub fn from_table<T>(table: T) -> Selfwhere T: Into<Table<'a>>,
Creates a new DELETE
statement for the given table.
let query = Delete::from_table("users");
let (sql, _) = renderer::Postgres::build(query);
assert_eq!(r#"DELETE FROM "users""#, sql);
sourcepub fn so_that<T>(self, conditions: T) -> Selfwhere
T: Into<ConditionTree<'a>>,
pub fn so_that<T>(self, conditions: T) -> Selfwhere T: Into<ConditionTree<'a>>,
Adds WHERE
conditions to the query. See
Comparable for more examples.
let query = Delete::from_table("users").so_that("bar".equals(false));
let (sql, params) = renderer::Postgres::build(query);
assert_eq!(r#"DELETE FROM "users" WHERE "bar" = $1"#, sql);
assert_eq!(vec![Value::from(false)], params);
Trait Implementations§
source§impl<'a> PartialEq<Delete<'a>> for Delete<'a>
impl<'a> PartialEq<Delete<'a>> for Delete<'a>
impl<'a> StructuralPartialEq for Delete<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Delete<'a>
impl<'a> Send for Delete<'a>
impl<'a> Sync for Delete<'a>
impl<'a> Unpin for Delete<'a>
impl<'a> UnwindSafe for Delete<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more