pub struct Update {
pub set: Vec<(String, String)>,
/* private fields */
}
Expand description
Represents a ´UPDATE´ clause builder for SQL queries
Fields§
§set: Vec<(String, String)>
Implementations§
Source§impl Update
impl Update
Sourcepub fn new(table: &str) -> Self
pub fn new(table: &str) -> Self
Creates a new Update
instance with the given table name.
§Example
use lumus_sql_builder::sqlite::{Update, Where};
let mut condition = Where::new();
condition.equal_to("age", "21");
let update = Update::new("users_tb").set(vec![
("name", "João")
]).condition(condition.build())
.build();
assert_eq!("UPDATE users_tb SET name = 'João' WHERE age = '21';", update.unwrap());
pub fn build(&self) -> Result<String, SqlBuilderError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Update
impl RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnwindSafe for Update
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