Persistence

Overview

Kinotic's persistence layer provides declarative data management with automatic CRUD service generation from TypeScript entity definitions.

Kinotic provides a declarative persistence layer. You define entities with TypeScript decorators, and Kinotic generates fully typed CRUD services automatically, including full-text search, pagination, and more.

Key Features

  • Automatic CRUD generation - Define an entity class and get a complete service with create, read, update, delete, search, and count operations
  • Full-text search - Mark fields with @Text to enable full-text search out of the box
  • Schema evolution - Use versioned migration scripts to evolve your data schema safely over time
  • Multi-tenancy - Built-in tenant isolation at the data layer with shared index support
  • Named queries - Define custom query methods with a SQL-like syntax
  • Attribute-based access control (ABAC) - Fine-grained data access policies applied at the persistence layer

Workflow

The typical workflow for working with Kinotic persistence is:

  1. Define your entity - Create a TypeScript class with decorators from @kinotic-ai/persistence
  2. Sync to server - Run kinotic sync to push your entity definitions to the Kinotic server and generate typed service classes
  3. Use in your app - Import and use the generated services to perform data operations

Packages

Two packages work together to provide the persistence layer:

  • @kinotic-ai/persistence - Provides entity decorators (@Entity, @AutoGeneratedId, @NotNull, @Text, etc.), entity service interfaces, and the persistence plugin
  • @kinotic-ai/core - Provides the connection layer (Kinotic.connect()), pagination types, and core utilities shared across all Kinotic packages
Copyright © 2026