Colt Language & Architecture Specification
Colt is a strictly-typed, unified data language for defining, querying, and mutating records across relational, key-value, document, and vector databases under provable multi-tenant isolation.
1. Language Overview
Source files use the .colt extension. Colt expressions are compiled into parameterized Abstract Syntax Trees (ASTs) and optimized execution plans by the Colt compiler.
// Declare strict schema and query records
DEFINE COLLECTION users STRICT @backend(neon) {
id: text @key,
email: text @unique,
tier: text @default("free")
}
FIND users SELECT id, email WHERE tier == "pro"
2. Schema Definition
Colt schemas support atomic primitive types: text, int, float, boolean, timestamp, and vector.
DEFINE COLLECTION books STRICT @backend(supabase) {
id: text @key,
title: text,
author: text,
rating: float @default(4.0),
embedding: vector(1536)
}
3. Mutations (PUT / DELETE)
Records are inserted or updated using the PUT statement with key targeting:
PUT books:item_101 {
title: "Database Internals",
author: "Alex Petrov",
rating: 4.8
}
4. Querying (FIND)
Query operations support projections, filters, sorting, and pagination:
FIND books SELECT id, title, rating
WHERE rating >= 4.5
ORDER BY rating DESC
LIMIT 20
5. Storage Backends & Routing
ColtaneDB directs queries to specialized backing engines according to the @backend(...) directive:
@backend(redis): Sub-millisecond key-value caching tier on Upstash Redis.@backend(neon)&@backend(supabase): ACID transactional relational storage.@backend(firestore): Document collection storage on Google Cloud Firebase.@backend(turso): Edge-distributed SQLite via libSQL.