Skip to content

edadma/petradb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

768 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PetraDB

Maven Central npm Last Commit License Scala Version Scala.js Version Scala Native Version

A lightweight, embeddable SQL database engine for JavaScript, TypeScript, and Scala. Compiles to JVM, Node.js, and Native. Includes a JDBC driver with full metadata support (tables, columns, primary keys, foreign keys, indexes, batch updates). No external dependencies, no server required.

Quick Start

JavaScript / TypeScript

npm install @petradb/engine
import { 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', 'alice@example.com');
`);

const [{ rows }] = await db.execute('SELECT * FROM users');
console.log(rows); // [{ id: 1, name: 'Alice', email: 'alice@example.com' }]

Scala

libraryDependencies += "io.github.edadma" %%% "petradb-engine" % "1.5.5"
import io.github.edadma.petradb.*
import io.github.edadma.petradb.engine.*

given Session = new MemoryDB().connect()

executeSQL("""
  CREATE TABLE users (id SERIAL, name TEXT NOT NULL, email TEXT);
  INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
  SELECT * FROM users;
""").foreach(println)

Documentation

Full documentation, SQL reference, and guides are available at petradb.dev.

License

ISC

About

A lightweight, embeddable SQL database engine for JavaScript, TypeScript, and Scala

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from edadma/cross_template