Release NotesORMv0.x
ORM v0.1.x
Release notes for Cerial ORM v0.1.x — the initial release.
0.1.0
The first public release of Cerial, covering the full schema language, query builder, type system, CLI tooling, and SurrealDB integration.
SurrealDB compatibility: 3.0.1 | SDK: surrealdb 2.x
Added
Schema Language
.cerialschema files with a clean, declarative syntax for defining models, objects, tuples, enums, and literals- 15 field types:
String,Int,Float,Bool,Date,Email,Record,Relation,Uuid,Duration,Decimal,Bytes,Geometry,Number,Any - Embedded object types (
object {}) with sub-field select, filtering, and partial updates - Tuple types (
tuple {}) for fixed-length typed arrays with named elements and flexible input forms - Literal types (
literal {}) for union types combining specific values, broad types, and structured variants - Enum types (
enum {}) for string-only named constants, generatingas constobjects and union types - Array fields with
Type[]syntax and full query/update operators - Set arrays via
@setdecorator for auto-deduplicated, sorted arrays - Optional fields (
?) and nullable fields (@nullable) with clean NONE vs null separation - Typed IDs with
Record(int) @id,Record(uuid) @id, union syntax, and automatic FK type inference - Schema-level inheritance with
extends,abstractmodels, pick/omit, and!!privatefields - Multi-schema support with per-schema client generation
Decorators
- Identity:
@id,@key - Relations:
@field,@model,@onDelete - Defaults:
@default,@defaultAlways - Timestamps:
@createdAt,@updatedAt,@now - UUID generation:
@uuid,@uuid4,@uuid7 - Geometry subtypes:
@point,@line,@polygon,@multipoint,@multiline,@multipolygon,@collection - Constraints:
@unique,@index,@nullable - Arrays:
@set,@distinct,@sort - Field behavior:
@readonly,@flexible - Composite:
@@index,@@unique
Query Methods
findOne,findMany,findUniquefor reading recordscreate,createManyfor inserting records with nested relation supportupdateMany,updateUniquefor updating recordsdeleteMany,deleteUniquefor removing recordsupsertfor create-or-update with separate create/update datacountandexistsfor efficient checks
Query Options
selectwith compile-time narrowed return typesincludefor loading related records with nested filtering, sorting, limit, and offsetwherewith full operator set (comparison, string, array, logical, existence)orderBy,limit,offsetfor paginationunsetfor clearing optional fields in updatesreturnmodes on unique operations:'before',true, or default
Filtering
- Comparison:
eq,neq,not,gt,gte,lt,lte,between - String:
contains,startsWith,endsWith - Array:
in,notIn,has,hasAll,hasAny,isEmpty - Existence:
isNull,isDefined,isNone - Logical:
AND,OR,NOT - Nested filtering through object sub-fields and relation traversal
Relations
- 1, 1, N with forward and reverse sides
- Self-referential relations
- Bidirectional N sync
- Nested
create,connect,disconnect @onDeletecascade strategies:Cascade,SetNull,SetNone,Restrict
Transactions
- Array mode with function items receiving previous results
- Callback mode with full model access and throw-to-rollback
- Manual mode with
commit()/cancel()andawait usingcleanup - Configurable retry with optional backoff for conflict resolution
- Automatic WebSocket connection when connected via HTTP
Type System
CerialId<T>generic record ID wrapperCerialUuid,CerialDuration,CerialDecimal,CerialByteswrapper classesCerialGeometryhierarchy with 7 subtypesCerialAnyrecursive union,CerialSet<T>branded array,CerialNonesymbolRecordIdInput<T>and per-class input union types- Generated interfaces, Select, OrderBy, Where, Include, GetPayload types per model
- Dynamic return types narrowing based on
selectandinclude
CLI
cerial generatewith--watch,--format,-s,-o,-C,-nflagscerial initwith--yesfor non-interactive scaffoldingcerial formatwith--checkand--watchmodes- Config via
cerial.config.ts/cerial.config.jsonwithdefineConfig()
Formatter
- Auto-formatting with column alignment, decorator ordering, and comment preservation
- 9 configurable format options
- Watch mode, check mode (CI), idempotent output
Migration Generation
DEFINE TABLE,DEFINE FIELD,DEFINE INDEXfrom schemaREADONLY,FLEXIBLE,DEFAULT,DEFAULT ALWAYSconstraintsDEFINE FIELD OVERWRITEfor typed@idfields