Meridian

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.

OptionTypeDefault
poolSizenumber10
timeoutduration30s
retriesnumber3
logLevelstringinfo

Client

createClient(options)

Returns a pooled client. Safe to create once and share across your application.

Errors

Every error extends MeridianError and carries a stable .code you can branch on.

CodeMeaning
E_TIMEOUTQuery exceeded the configured timeout
E_CONFLICTWrite conflicted with a concurrent transaction
E_AUTHCredentials rejected or expired
Get all 8 templates · $19