Repository navigation
schema-engine
schema-engine v2.1.0
The schema engine powers Dbcube's declarative schema workflow: it reads your
.cube files and turns them into real database structure across MySQL,
PostgreSQL, SQLite and MongoDB.
What's new in v2.1.0
Vector columns are now part of the schema language. A table stops being
either relational or vectorial — it can be both, and the engine materializes it.
-
New column types
vectorandblob. Avectorcolumn declares its
dimension, and optionally a metric, an index method and the columns that feed
it:embedding: { type: "vector"; dimension: 1536; // required — the per-column lock metric: "cosine"; // cosine | euclidean | dotProduct index: "hnsw"; // hnsw | ivfflat | none from: ["name", "description"]; // auto-embed source columns model: "text-embedding-3-small"; sync: "auto"; };
-
What it generates on PostgreSQL —
CREATE EXTENSION IF NOT EXISTS vector
before the table, the column asvector(<dimension>), and an ANN index after
it with the opclass derived from the metric (cosine →vector_cosine_ops,
euclidean →vector_l2_ops, dotProduct →vector_ip_ops). Bothtable:fresh
andtable:refreshemit them. -
dbcube_vectors_config— the engine persists one row per vector column
(dimension, metric, index type,from, model, sync) into the local config
database. This is the contract the ORM reads to auto-embed on insert/update
and to search the column; without it the declarative half would not exist. -
Vectors are PostgreSQL-only, and say so. On another engine, or with the
dimension missing,table:freshfails with an explicit error instead of
producing a table that would break at the first query.
Everything is additive: a .cube without vector columns parses and behaves
exactly as before.
Fixed
- Boolean
defaultValueno longer breaks PostgreSQL. A column declared
{ type: "boolean"; defaultValue: "false" }generatedDEFAULT 0, which
PostgreSQL rejects outright ("column is of type boolean but default
expression is of type integer") because it has a real BOOLEAN type and no
implicit cast from integer. It now emitsDEFAULT TRUE/DEFAULT FALSEon
PostgreSQL and keeps1/0on MySQL and SQLite, which have no boolean type
of their own. descriptionis optional in@metaagain.@meta({ name: "users"; });
did not match the parser, so the table name came out empty and the engine
emittedCREATE TABLE (...)— a syntax error that named no table. A missing
name is now a clear error at parse time instead of invalid SQL at execution
time, and the properties may appear in any order.
Also included (from the unreleased v1.1.2 line)
config.dbis created whenever the engine runs. Applying a trigger in a
project with no prior migration used to fail withunable to open database file(SQLite code 14), because.dbcube/config.dbwas only created by table
operations. The config's SQLite connector now usescreate_if_missing.- PostgreSQL seeder, autoincrement and
freshdrop-order fixes.
What's new in v1.1.1
- Cloud databases over TLS — connect to managed providers (Supabase, Neon,
RDS, PlanetScale, Aiven, MongoDB Atlas) with a singleURLconnection string;
TLS is negotiated automatically. - Managed databases skip
CREATE DATABASE— when aURLis provided the
database already exists at the provider, so the engine no longer attempts to
create it (fixes a "zero-length delimited identifier" error on cloud setups).
What it does
.cubeschema files — parses.table.cube,.alter.cube,.seeder.cube
and.trigger.cubedefinitions.- Migrations —
table:fresh,table:refreshandtable:altercreate and
evolve tables, ordering them so foreign-key targets come first. - Safe ALTERs with rollback —
.alter.cubeapplies only pending changes;
migrate:rollbackreverts them. - Seeders & triggers — loads seed datasets and registers runtime triggers.
- Introspection —
dbcube run pullgenerates.cubefiles from an existing
database.
Binaries available
Latest
| Platform | Download |
|---|---|
| Windows x64 | schema-engine-v2.1.0-windows-x64.zip |
| Linux x64 | schema-engine-v2.1.0-linux-x64.zip |
| macOS x64 (Intel) | schema-engine-v2.1.0-macos-x64.zip |
| macOS arm64 (Apple Silicon) | schema-engine-v2.1.0-macos-arm64.zip |
Install / update
The correct binary for your platform is fetched automatically, or explicitly:
dbcube run download schema-engine # latest
dbcube run download schema-engine v2.1.0 # a specific versionCompatibility
- Node.js 18+ · Windows x64, Linux x64, macOS x64 & arm64.
- Works with MySQL, PostgreSQL, SQLite and MongoDB — local or cloud (TLS).
- Vector columns require PostgreSQL with the
pgvectorextension available.
Checksums (SHA-256)
d620293ea060db46dd7c048285713bdb2b68e8cac11281479bffcfb4000c5b8e schema-engine-v2.1.0-windows-x64.zip
4b9bb7ceceaef4a3c7fd8162dad6532789172877b4c25e5acb9c032ba288b040 schema-engine-v2.1.0-linux-x64.zip
79ef98a21629446ab75238e60fbcda1cd8dacf931e473b9e73bdc47a51e34cd9 schema-engine-v2.1.0-macos-x64.zip
515737b779775e61afb5a8b1b1c7b354757d20e535d4aaa24f884d642fd77ae1 schema-engine-v2.1.0-macos-arm64.zip