@@ -38,6 +38,13 @@ const db = new SQL.Database();
3838// NOTE: You can also use new SQL.Database(data) where
3939// data is an Uint8Array representing an SQLite database file
4040
41+
42+ // Execute a single SQL string that contains multiple statements
43+ sqlstr = " CREATE TABLE hello (a int, b char); \
44+ INSERT INTO hello VALUES (0, 'hello'); \
45+ INSERT INTO hello VALUES (1, 'world');" ;
46+ db .run (sqlstr); // Run the query without returning anything
47+
4148// Prepare an sql statement
4249const stmt = db .prepare (" SELECT * FROM hello WHERE a=:aval AND b=:bval" );
4350
@@ -54,9 +61,10 @@ stmt.free();
5461// But not freeing your statements causes memory leaks. You don't want that.
5562
5663// Execute a single SQL string that contains multiple statements
57- let sqlstr = " CREATE TABLE hello (a int, b char);" ;
58- sqlstr += " INSERT INTO hello VALUES (0, 'hello');"
59- sqlstr += " INSERT INTO hello VALUES (1, 'world');"
64+ let sqlstr =
65+ " CREATE TABLE hello (a int, b char); \
66+ INSERT INTO hello VALUES (0, 'hello'); \
67+ INSERT INTO hello VALUES (1, 'world');" ;
6068db .run (sqlstr); // Run the query without returning anything
6169
6270const res = db .exec (" SELECT * FROM hello" );
0 commit comments