CAD-SYS // ULTSQL-KERNEL v1.0.26
COORD: X: 0000 | Y: 0000
JITTER: 0.08ms
View on pub.dev GitHub Repository
100% Pure Dart • Zero Native C/C++ • FSL-1.1-MIT

One Core.
Every Model.

A converged multimodal database engine unifying Relational SQL, AI Vector RAG, NoSQL JSON Documents, and PL/SQL Scripting into a single storage engine with zero external dependencies.

Try Playground Documentation
$ dart pub add ultsql
142,000+ Ops / Sec
0 Native C Deps
768-Dim HNSW Vector
MVCC ACID Engine
ARCH // UNIFIED MULTIMODAL CORE v1.0.26
INPUT MODEL:
INGRESS
Pgwire :5432 PostgreSQL Wire & Memory Bus
→
PARSER / AST
SQL-92 + JSON + SIMD Pure Dart Zero-Copy Lexer
→
EXEC KERNEL
Cost-Based Optimizer MVCC + ARIES Log Engine
PHYSICAL PLAN & EXECUTION STREAM 0.82 ms
01 PLAN: INDEX_SCAN(users_pk) -> HASH_JOIN(orders_fk) -> AGGREGATE(SUM)
02 STORAGE: PAGE #0001 (CRC32: 0x9F4C2A) • 4KB Slotted Buffer
03 OUTPUT: Om Patel (Lead Architect) | Orders: $14,630.00 | STATUS: COMMITTED
Live Sandbox

In-Browser Multimodal Engine

Run real Relational Queries, HNSW Vector Distance, JSON Traversal, and PL/SQL Procedural Scripts compiled directly into JavaScript via Dart WebAssembly.

ultsql_engine.js: Ready
SQL QUERY EDITOR CTRL + ENTER TO RUN
EXECUTION OUTPUT Ready
Click Run Query above to execute against the pure Dart engine.
Multimodal Architecture

Four Paradigms. One Engine.

Unified storage engine executing relational queries, high-dimensional vector embeddings, document queries, and stored procedural scripts.

01

Relational SQL Core

Complete ACID compliance with MVCC snapshot isolation, multi-table joins, nested subqueries, and B-Tree indexing on 4KB Slotted Pages with CRC32 verification.

  • ANSI-SQL JOIN, GROUP BY, HAVING
  • Write-Ahead Logging (WAL) Recovery
  • Multi-Column Unique & Foreign Keys
SELECT u.name, SUM(o.total)
FROM users u INNER JOIN orders o
ON u.id = o.user_id GROUP BY u.name;
02

AI Vector RAG (HNSW)

Native Hierarchical Navigable Small World (HNSW) graphs integrated directly into the database engine. Execute millisecond vector search over high-dimensional embeddings.

  • Cosine, Euclidean & Dot Product distance
  • 384, 768, 1536, and 3072 dimensions
  • Hybrid filtered search with SQL predicates
SELECT title, VECTOR_DISTANCE(vec, :q)
FROM documents WHERE status = 'active'
ORDER BY 2 ASC LIMIT 5;
03

NoSQL JSON Documents

Store schema-less nested JSON documents with native dotted path queries, array indexing, and automatic validation without schema lock-in.

  • Direct extraction via -> and ->> operators
  • In-place nested attribute mutations
  • Seamless combination with Relational tables
SELECT data->'auth'->>'role'
FROM profiles
WHERE data->>'plan' = 'pro';
04

PL/SQL Scripting

Execute complex procedural logic directly inside the database kernel. Declare typed variables, loops, conditionals, and atomic transactions without network round-trips.

  • DECLARE, BEGIN, EXCEPTION, END blocks
  • WHILE / FOR loops & IF-THEN branching
  • Transactional rollback on script error
DECLARE cnt INT := 0;
BEGIN WHILE cnt < 10 LOOP
cnt := cnt + 1; INSERT INTO t VALUES (cnt);
END LOOP; END;
Bklit UI Data Visualization

Engine Throughput & Latency

Audited performance under automated workloads against native C SQLite, Dart Drift FFI, and Hive.

Automated Benchmark Suite

Interactive Monochrome Visualizer Powered by Anime.js v4

Tested on Apple M3 Max (36GB RAM) & AMD Ryzen 9 7950X (64GB RAM). View Full Audit
Engine Architecture

Engineered for Reliability & Portability

Designed from the ground up for modern Dart & Flutter applications across Mobile, Desktop, Server, and Web.

PURE DART VM

Zero Native C/C++ Toolchain

No CMake, NDK, Xcode toolchain mismatches, or dynamic library linking headaches. Write once, compile deterministically everywhere.

STORAGE SYSTEM

4KB Slotted Pages with CRC32

Slotted page file format with variable-length tuple offsets and hardware-accelerated CRC32 checksums on every disk read.

CRASH RESILIENCE

Write-Ahead Logging (WAL)

Guarantees durability with ARIES-style redo logging and atomic transaction commit markers. Instant recovery on unexpected app termination.

WIRE PROTOCOL

PostgreSQL (pgwire) Compatible

Embedded Pgwire server allowing standard clients like psql, DBeaver, and Supabase studio to connect directly to your ULTSQL database.

CONCURRENCY

MVCC Snapshot Isolation

Multi-Version Concurrency Control ensures readers never block writers, and writers never block readers across concurrent database transactions.

PERSISTENCE

Single-File (.ultsql) & In-Memory

Zero external server dependencies. Run completely ephemeral in RAM or persist transparently to a clean single `.ultsql` file on disk.

Quickstart

Up and Running in 30 Seconds

Add the package, open an instance, and start executing multimodal queries immediately.

dart pub add ultsql
EXAMPLE: main.dart
import 'package:ultsql/ultsql.dart';

void main() async {
  // 1. Open a single-file database instance
  final db = await UltSqlDatabase.openFile('app_data.ultsql');

  // 2. Execute multimodal DDL and Vector search
  await db.execute('''
    CREATE TABLE docs (id INT PRIMARY KEY, content TEXT, embedding VECTOR);
    INSERT INTO docs VALUES (1, 'Hello World', '[0.1, 0.9, -0.4]');
  ''');

  // 3. Query with nearest vector distance
  final results = await db.query(
    'SELECT content, VECTOR_DISTANCE(embedding, :q) AS dist FROM docs ORDER BY dist ASC',
    params: {'q': '[0.12, 0.88, -0.42]'},
  );

  print(results);
}
ESC
✓ Copied