Skip to main content
db-common

Shared, tree-shakeable TypeScript database utilities.

query.ts
import { paginate } from '@rtorcato/db-common'

const { limit, offset } = paginate({ page: 2, size: 25 })
// → { limit: 25, offset: 25 }
npm install @rtorcato/db-common

Use with AI

A skill ships with the package so coding agents use db-common correctly — whichever tool you're in.

Read the rules →
Any coding agent
Pull the skill into any tool the skills CLI supports.
npx skills add https://github.com/rtorcato/db-common --skill db-common
Claude Code
The repo is its own plugin marketplace — add it, then install the skill.
/plugin marketplace add rtorcato/db-common
/plugin install db-common@db-common
Cursor, Copilot, Codex
They read AGENTS.md. It ships in the npm tarball, so it is already in your node_modules.
node_modules/@rtorcato/db-common/AGENTS.md
TypeScript-first
TypeScript-first
Strict types, generics preserved, JSDoc-rich in your IDE. Helpers that infer, not just accept `any`.
Tree-shakeable
Tree-shakeable
Ships ESM and CommonJS, with `sideEffects: false`. Bundlers keep just the helpers you import — nothing else ships.
Database-agnostic
Database-agnostic
Small primitives for query building, pagination, and result shaping — independent of any single driver.
Safe by default
Safe by default
Predictable return shapes and guarded edges. No surprise throws from the common path.

Sibling projects

More from @rtorcato — same conventions, same release pipeline.