-
Notifications
You must be signed in to change notification settings - Fork 1
backend Overview
GitHub Action edited this page Apr 21, 2026
·
2 revisions
This package provides the database abstraction layer for Quatrain Core. It adds persistence capabilities to the in-memory objects from @quatrain/core.
-
Abstract Adapter:
AbstractBackendAdapterdefines a consistent interface for all database adapters. - Query Builder: A powerful query system with support for filtering, sorting, and pagination.
- Repositories: Implements the repository pattern for a clean data access layer.
- Middleware Support: Hooks for data transformation and validation before database operations.
npm install @quatrain/backendThis package is meant to be used with a concrete database adapter, such as @quatrain/backend-postgres or @quatrain/backend-firestore.
import { Backend, Filter, OperatorKeys } from '@quatrain/backend'
import { User } from '@quatrain/core'
// Assuming an adapter has been added
const users = await Backend.find(User.factory(), [
new Filter('status', 'active', OperatorKeys.equals),
])For concrete examples and usage guides, please refer to the How-To Guide.