Application Foundation · BaseORM

Define the schema. The engine derives the rest.

A data access engine for Go; table schema, migrations, permission filters, caching, and pagination are derived from a single metadata definition. It doesn't handle authentication or transport — it's a standalone module that works with the context it's given.

Status
Prototype
Last verified
2026-07-18
Access
TODO_CONTENT_CONFIRMATION

The problem it solves

In Go projects, the data access layer is usually hand-written: schema, migrations, permission checks, and pagination logic are rebuilt in every service and tend to drift out of sync over time.

BaseORM aims to reduce that manual synchronization burden by deriving all of it from a single metadata definition.

How it works

  1. Define your entity in metadata — fields, relations, tenantScoped and mask flags.

  2. The engine derives the schema and runs migrations with Atlas.

  3. Query definitions compile to parameterized SQL with minimal joins.

  4. Permissions, masking, caching, and pagination apply automatically on every query.

Verified capabilities

A deterministic SQL compiler

No reflection is used; the same query definition produces the same parameterized SQL on every run — this behavior is checked with golden-vector tests.

Permissions compiled into the query

Access filters are compiled into the SQL WHERE clause, aiming to keep unauthorized rows out of application memory.

Counter-based cache invalidation

Every entity carries its own generation counter; a write bumps the counter and stale cache keys are treated as invalid — no scans or bulk deletes needed.

Pagination strategy chosen by the engine

LIMIT/OFFSET for shallow pages, keyset cursors for deep ones — chosen by the engine; the primary key is added automatically as a tiebreaker for ordering.

Architecture and integration

BaseORM is a standalone Go module; it uses its own deterministic AST-to-SQL generation layer built on pgx and Atlas Community Edition.

It imports and applies the criteria/SecurityContext/metadata types from the shared F0 contract schemas; on the UI side it passes uiHint fields through directly, without carrying UI-specific logic.

Trust and control model

It doesn't handle authentication or transport — those are the calling service's responsibility. BaseORM only enforces the security context it's given.

Cache invalidation and query-compiler behavior are tested in a development environment against real PostgreSQL; a comprehensive, independently verified test report has not yet been published.

Known limits / areas for improvement

Access model not yet settled

The access model hasn't been confirmed by the product owner yet.

No independent performance verification

Claims about cache invalidation cost describe a design goal; an independent measurement or benchmark report hasn't been published yet.

Prototype maturity level

The engine is at the prototype stage; hardening under production load is ongoing.

Evidence

Golden-vector tests and development-environment tests against real PostgreSQL run as part of the internal process; a publicly available, independently verifiable test report or evidence link doesn't exist yet. This section will be updated once one is published.

A standalone Go data access engine that doesn't authenticate and doesn't know transport.

Request a technical call