Skip to content

SQL Compatibility ​

DataVo SQL is a compact embedded-engine dialect designed for predictable, zero-allocation execution in .NET. It covers standard relational CRUD, joins, aggregates, transactions, and vector search without emulating PostgreSQL or SQLite system catalogs.

sql
CREATE TABLE documents (
    id INT PRIMARY KEY,
    title VARCHAR(200),
    category VARCHAR(80),
    embedding VECTOR(384)
);

SELECT id, title, embedding <=> '[0.1, 0.2, ...]' AS distance
FROM documents
WHERE category = 'guide'
ORDER BY distance ASC
LIMIT 5;

Dialect Matrix (DataVo v0.4 vs. SQLite & PostgreSQL) ​

FeatureDataVo v0.4SQLite / PostgreSQL Difference
CREATE / DROP (DATABASE, TABLE, INDEX)SupportedUses DROP INDEX name ON table; supports USING BTREE, HNSW, FLAT, COLUMNAR.
ALTER TABLELimitedSupports ADD COLUMN, DROP COLUMN, MODIFY COLUMN; rejects key, FK, or indexed column changes.
INSERT, UPDATE, DELETE, VACUUMSupportedNo MERGE, UPSERT (ON CONFLICT), RETURNING, or PostgreSQL COPY.
Transactions & SavepointsSupportedSnapshot isolation via BEGIN, COMMIT, ROLLBACK, SAVEPOINT, ROLLBACK TO, RELEASE; not serializable.
SELECT, WHERE, ORDER BY, LIMIT, OFFSETSupportedSELECT DISTINCT runs on the general evaluator; ORDER BY ... LIMIT k uses bounded top-k on typed paths.
Joins (INNER, LEFT, RIGHT, FULL, CROSS)SupportedINNER/LEFT on integer keys use typed hash joins; RIGHT/FULL/CROSS and text/GUID keys use the general path.
Aggregates, GROUP BY, HAVINGSupportedCOUNT, SUM, AVG, MIN, MAX (including DISTINCT); HAVING works with or without GROUP BY.
Subqueries & CTEsSupportedIN (SELECT ...), EXISTS, NOT EXISTS; non-recursive WITH CTEs (WITH RECURSIVE is reactive-only).
Set OperationsPartialUNION and UNION ALL supported; INTERSECT and EXCEPT are not supported.
Window FunctionsLimitedRANK() OVER ([PARTITION BY ...] ORDER BY ...) only; no ROW_NUMBER, DENSE_RANK, LAG, LEAD, or frames.
Scalar Functions & ExpressionsLimitedLOWER, UPPER, arithmetic + - * /; no CASE WHEN, COALESCE, CAST, PRAGMA, or date/math functions.
Vector Search (VECTOR(n), <->, <=>)SupportedNative DataVo extension (similar to pgvector, without <#> inner-product).
Views, Triggers, Procedures, UDFsNot supportedUse Live Reactive Views (Subscribe) for continuous queries in C#.
System Catalogs (pg_class, sqlite_master)Not supportedUse SHOW DATABASES, SHOW TABLES, DESCRIBE <table>, and EXPLAIN.
RBAC Security CommandsSupportedCREATE USER/ROLE, GRANT, REVOKE, LOGIN, LOGOUT, SHOW USERS/ROLES/GRANTS (not PostgreSQL roles).

Execution Paths & Performance Notes ​

Every construct marked Supported returns identical results across storage modes, but execution speed varies by path:

  • Typed fast paths: Single-table filters, aggregates, BETWEEN on clustered primary keys, and INNER/LEFT joins on integer equality keys read stored rows directly with minimal allocations.
  • General evaluator: SELECT DISTINCT, RIGHT/FULL/CROSS joins, joins on VARCHAR or GUID keys, cross-table OR predicates, CTEs, window functions, and queries inside explicit transactions materialize row dictionaries and are slower on large tables.

Key Type Differences ​

  • FLOAT is 32-bit (System.Single), unlike SQLite REAL or SQL Server FLOAT (64-bit). Use DOUBLE for 64-bit floating-point values.
  • VARCHAR comparisons are ordinal (UTF-8 byte/code-point order), not collation-aware or case-insensitive.
  • No silent type fallbacks: Unsupported types such as DECIMAL, NUMERIC, DATETIME, and TIMESTAMP throw an explicit ParserException instead of silently storing text.

See Also ​

  • Data Types: Supported SQL types, .NET CLR mappings, and unsupported type errors
  • Query Planner: How DataVo chooses between typed fast paths and the general evaluator
  • Functions & Operators: Complete list of aggregates, window functions, scalar functions, and operators