Installation
Install the client with your package manager of choice. Node 18 or newer is required.
# npm npm install @meridian/client # pnpm pnpm add @meridian/client
Quickstart
Create a client and run your first query. Connections are pooled automatically.
import { createClient } from '@meridian/client' const db = createClient({ url: process.env.MERIDIAN_URL }) const users = await db.from('users').where({ active: true })
Note
Keep your connection string in an environment variable — never commit it to source control.
Configuration
Options are read from meridian.toml, then overridden by environment variables.
| Option | Type | Default |
|---|---|---|
poolSize | number | 10 |
timeout | duration | 30s |
retries | number | 3 |
logLevel | string | info |
Client
createClient(options)
Returns a pooled client. Safe to create once and share across your application.
url— connection string, requiredpoolSize— maximum concurrent connectionstimeout— per-query timeout before rejection
Errors
Every error extends MeridianError and carries a stable .code you can branch on.
| Code | Meaning |
|---|---|
E_TIMEOUT | Query exceeded the configured timeout |
E_CONFLICT | Write conflicted with a concurrent transaction |
E_AUTH | Credentials rejected or expired |