We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04e40af commit 4341d99Copy full SHA for 4341d99
sqlite-cloud/write-data.mdx
@@ -44,7 +44,7 @@ const db = new Database('sqlitecloud://<your-project-id>.sqlite.cloud:<your-host
44
db.exec('USE DATABASE <your-database-name>.sqlite;')
45
db.exec('CREATE TABLE sports_cars (sc_id INTEGER PRIMARY KEY, sc_make TEXT NOT NULL, sc_year INTEGER NOT NULL);')
46
db.commit()
47
-const insertData = async () => await db.sql`INSERT INTO sports_cars (sc_make, sc_year) VALUES ('Ferrari', 2021);`;
+const insertData = async () => await db.sql('INSERT INTO sports_cars (sc_make, sc_year) VALUES (?, ?)', 'Ferrari', 2021);
48
49
insertData().then((res) => console.log(res));
50
// "OK"
0 commit comments