Skip to main content
Deno 2 is finally here 🎉️
Learn more
#!/usr/bin/env deno run

import SQL from "https://deno.land/x/lite";

const db = SQL(":memory:");
const tableName = SQL`Message`;
await db(SQL`CREATE TABLE ${tableName} (body text)`);

const message = "Hello, world!";
await db(SQL`INSERT INTO ${tableName} VALUES (${message})`);
const query = SQL`SELECT * FROM ${tableName}`;
const rows = await db(query);

console.log(rows);
[ { body: "Hello, world!" } ]