Function Database.run
Runs an SQL script that can contain multiple statements.
Parameters
Name | Description |
---|---|
script | The code of the SQL script. |
dg | A delegate to call for each statement to handle the results. The passed ResultRange will be empty if a statement doesn't return rows. If the delegate return false, the execution is aborted. |
Example
auto db = Database(":memory:");
db .run(`CREATE TABLE test1 (val INTEGER);
CREATE TABLE test2 (val FLOAT);
DROP TABLE test1;
DROP TABLE test2;`);