A lightweight, embeddable SQL database engine for JavaScript, TypeScript, and Scala. Compiles to JVM, Node.js, and Native. No external dependencies, no server required.
npm install @petradb/engineimport { Session } from '@petradb/engine';
const db = new Session();
await db.execute(`
CREATE TABLE users (id SERIAL, name TEXT NOT NULL, email TEXT);
INSERT INTO users (name, email) VALUES ('Alice', '[email protected]');
`);
const [{ rows }] = await db.execute('SELECT * FROM users');
console.log(rows); // [{ id: 1, name: 'Alice', email: 'alice@example.com' }]libraryDependencies += "io.github.edadma" %%% "petradb-engine" % "1.1.1"import io.github.edadma.petradb.*
given Session = new MemoryDB().connect()
executeSQL("""
CREATE TABLE users (id SERIAL, name TEXT NOT NULL, email TEXT);
INSERT INTO users (name, email) VALUES ('Alice', '[email protected]');
SELECT * FROM users;
""").foreach(println)Full documentation, SQL reference, and guides are available at petradb.dev.