Xeplr OS / Services

@xeplr/db

Database connection manager, BaseModel, and migration utilities for Knex + Objection.js

Install

npm install @xeplr/db

The idea

BaseModel scopes every query to the request’s tenant and stamps the audit columns on write, so a route cannot forget the filter. A background worker, which has no request, picks rows unscoped and then runs each one inside its own tenant’s context.

Where it sits

Part of Services — long-running pieces. Each one boots with the same init() / start() / router() shape and mounts into an Express app you already have.

Third-party dependencies

  • dotenv
  • knex
  • objection
  • pg

Documentation for @xeplr/db is in its README on npm.

These packages are what Xeplr Analytics is made of

If you are assembling this yourself, it may be worth seeing the assembled version first.