@oliphaunt/ts
v0.3.1
Published
TypeScript SDK for Oliphaunt on Node.js, Bun, and Deno.
Readme
Oliphaunt TypeScript SDK
Run native PostgreSQL in Node.js, Bun, Deno, or Electron. For browsers, choose WASIX TypeScript.
Install
npm install @oliphaunt/tsThe quickstart covers prerequisites and the versions documented by the current site. Pin dependencies in your application manifest or lockfile.
First query
import { Oliphaunt } from '@oliphaunt/ts';
const db = await Oliphaunt.open();
try {
const result = await db.query('SELECT $1::int4 AS answer', [42]);
console.log(result.rows[0]?.answer); // 42
} finally {
await db.close();
}Default storage is a disposable temporary directory. Direct mode stays bound to its first root and configuration for the lifetime of the process, even after closing a handle. Use the quickstart's persistent-storage example for application data; run it as an alternative to this disposable example. Always close database handles explicitly.
Build your integration
- Guide: parameters, transactions, extensions, backups, and shutdown.
- API reference: methods, configuration, results, and errors.
- Runtime support: platforms, storage, and concurrency.
- Releases and upgrades: dependency and database upgrades.
