Database layer for
TypeScript backends
Define your schema once. Query with full type safety, swap databases freely, and extend with plugins — without adopting a full framework.
See it in action
Real queries, real output. Browse CRUD operations and explore how Datrix handles relations, filters, and nested queries.
datrix.create("tag", {
name: "GraphQL",
color: "#E10098"
}){
"id": 6,
"name": "GraphQL",
"color": "#E10098",
"createdAt": "2026-04-06T22:19:27.505Z",
"updatedAt": "2026-04-06T22:19:27.505Z"
}Everything you need, nothing you don't
Datrix is a minimal, type-safe database framework designed to integrate into your existing stack — not replace it.
Fully Typed
Schema types generated via CLI. Full IntelliSense and compile-time safety across queries, relations, and plugins.
Adapter System
Swap databases without touching your business logic. Each adapter handles query translation, migrations, and relation population independently.
Full query translation, relations, migrations.
MySQL & MariaDB support.
Full CRUD, population, migration support.
File-based adapter for local dev & testing.
CLI Tooling
Everything from the terminal — migrations, type generation, and resource scaffolding.
API Plugin
Drop in the API plugin to get a full REST layer — authentication, permissions, and query parsing included.
Auto-generated CRUD routes for every schema.
JWT & session, register/login/logout/me built-in.
Role-based access control per route and schema.
Filter, populate, sort, paginate via URL params.
Plugin Architecture
Extend core through a structured plugin system. REST API, file uploads — only add what you need.
Migration System
Schema changes tracked and applied through versioned migrations managed entirely via CLI.
Zero Lock-in
Datrix integrates into your existing stack. No framework takeover, no opinionated project structure.
Works with your stack
Datrix is framework-agnostic. Use it with any TypeScript backend — no lock-in.