-
Notifications
You must be signed in to change notification settings - Fork 52
Update statement
Ravi Teja Gudapati edited this page Jan 17, 2019
·
5 revisions
Update
statement builder can be used to update records in a table. The table to be updated is provided during construction of the Update statement.
final update = Update('person');
Use setValue
method to set a column in the record.
final update= Update('person').setValue('age', 29);
Use setValues
method to set multiple columns with a single call.
final update = Update('person').setValues({
'name': 'Teja',
'age': 29,
});
The above statement is equivalent to:
UPDATE person SET name='Teja', age=29;
Use setInt
, ``setString,
setBool` and `setDateTime` methods to set columns values in a type safe manner.
TODO
Use the exec
method to execute an insert statement.
final insert = Insert('person').setValues({
'name': 'Teja',
'age': 29,
});
await insert.exec(adapter);