@petradb/client
v1.5.1
Published
PetraDB network client for JavaScript and TypeScript
Maintainers
Readme
@petradb/client
Network client for connecting to a PetraDB server from JavaScript and TypeScript. Works in both Node.js and the browser.
Installation
npm install @petradb/clientQuick Start
import { Session } from '@petradb/client';
const db = new Session({ host: 'localhost', port: 5480 });
await db.connect();
const results = await db.execute(`
CREATE TABLE users (id SERIAL, name TEXT);
INSERT INTO users (name) VALUES ('Alice');
SELECT * FROM users;
`);
console.log(results);
await db.close();Documentation
Full documentation at petradb.dev.
