Skip to content

Commit 4341d99

Browse files
committed
used correct syntax
1 parent 04e40af commit 4341d99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sqlite-cloud/write-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const db = new Database('sqlitecloud://<your-project-id>.sqlite.cloud:<your-host
4444
db.exec('USE DATABASE <your-database-name>.sqlite;')
4545
db.exec('CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);')
4646
db.commit()
47-
const insertData = async () => await db.sql`INSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);`;
47+
const insertData = async () => await db.sql('INSERT INTO sports_cars (sc_make, sc_year) VALUES (?, ?)', 'Ferrari', 2021);
4848

4949
insertData().then((res) => console.log(res));
5050
// "OK"

0 commit comments

Comments
 (0)