mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-07-26 05:43:45 +00:00
13 lines
299 B
JavaScript
13 lines
299 B
JavaScript
import { Database } from 'limbo-wasm';
|
|
|
|
const db = new Database('hello.db');
|
|
|
|
db.exec('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)');
|
|
|
|
db.exec('INSERT INTO users (name) VALUES (\'Alice\')');
|
|
|
|
const stmt = db.prepare('SELECT * FROM users');
|
|
|
|
const users = stmt.all();
|
|
|
|
console.log(users);
|