Database

Learn how to use Supersaas Database in your site

We use SQLite for our database., you can use the useDB() composable to access the database and perform CRUD operations.

Drizzle ORM

Supersaas uses Drizzle ORM for performing SQL queries and operations.

Example

index.ts
// GET

const users = await useDB().select().from("users");

// POST
const post = await useDB().insert("posts").values({ title: "Hello World" });

// UPDATE
await useDB().update("users").set({ name: "John Doe" }).where({ id: 1 });

// DELETE
await useDB().delete().from("users").where({ id: 1 });

UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS
UNLIMITED ACCESS PASS