β

ObjectQL v4.0 is currently in Beta.

ObjectStack LogoObjectQL

Introduction

ObjectQL — The Protocol-Driven Database Compiler for Metadata-First Applications

What is ObjectQL?

ObjectQL is a protocol-driven database compiler that turns declarative YAML schemas into type-safe, validated backend APIs. Instead of writing boilerplate CRUD code, you define what your data looks like — ObjectQL handles how it gets stored, validated, and served.

# Define your data model — ObjectQL does the rest
name: project
fields:
  title:
    type: text
    required: true
  status:
    type: select
    options: [planning, active, completed]
    default: planning
  owner:
    type: lookup
    reference_to: users

From this single file, ObjectQL automatically generates:

  • Database tables with proper types and indexes
  • Validation for required fields, select options, and referential integrity
  • REST, GraphQL, OData, and JSON-RPC APIs for all CRUD operations
  • TypeScript types for complete end-to-end type safety

Why ObjectQL?

Traditional ORMObjectQL
Schema defined in code (classes/decorators)Schema defined in YAML/JSON — readable by humans and AI
Queries are language-specific method chainsQueries are a universal JSON AST — portable across languages
Validation added manually per endpointValidation injected automatically by the engine
Database-coupled logicDriver-agnostic — swap databases without changing business logic
REST API requires separate controller layerAPIs auto-generated from metadata

Core Capabilities

Production-Ready

  • 6 Database Drivers — SQL (PostgreSQL, MySQL, SQLite), MongoDB, Memory, File System, Excel, Redis
  • 4 API Protocols — REST, GraphQL, OData V4, JSON-RPC — auto-generated from your schema
  • Validation Engine — Field-level, cross-field, and state machine validation
  • Formula Engine — Computed fields with JavaScript expressions and dependency tracking
  • Hook System — Complete lifecycle events: beforeCreate, afterUpdate, beforeDelete, etc.
  • Action System — Custom RPC operations callable via any API protocol

Developer Experience

  • VS Code Extension — YAML autocomplete, validation, and go-to-definition for .object.yml files
  • CLI Toolingcreate, generate, dev, build, test commands
  • Hot Reload — Schema changes detected and applied automatically during development
  • AI-Ready — JSON AST queries can be generated by LLMs and AI agents

How It Works

Define your schema in .object.yml files — fields, relationships, validation rules, and business logic.

ObjectQL compiles the schema into an internal AST, validates it, and registers metadata.

At runtime, the engine intercepts CRUD operations, applies validation and hooks, then delegates to the configured database driver.

API protocols (REST, GraphQL, etc.) are generated automatically from the compiled metadata.

Documentation Guide

SectionWhat You'll Learn
Getting StartedInstallation, project scaffolding, first CRUD operations
Modeling DataObject definitions, all field types, relationships, migrations
Business LogicFormulas, hooks, and custom actions
Data AccessQuery API, filter operators, best practices
DriversDatabase driver setup, configuration, and comparison
Server & APIsHTTP server integration, authentication, deployment
PerformanceQuery optimization, caching, connection pooling
ExtendingBuild custom drivers, plugins, and protocol adapters
ArchitectureInternal design: Types, Core engine, Platform layer
API ReferenceComplete REST, GraphQL, OData, JSON-RPC specifications

Next Steps

On this page