Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank
No. 1820Tools index

Previous survey · No. 1721 ·

Pricing
Open Source
Type
TOOL
Use case
Data Processing
Interfaces
SDK · CLI · Web · API
GitHub
5 stars
Date

About

DortDB is a JavaScript/TypeScript query engine that runs SQL, Cypher, and XQuery directly against in-memory arrays, DOM trees, and graphs without copying data into a separate database. It compiles all supported languages into a shared algebra, letting queries mix languages in a single plan and be extended with custom languages, functions, or optimizer rules.

What it does

A query library for TypeScript apps. You register data you already hold, such as a list of records, a parsed XML document or a graph object, under a name, and then ask questions of it in SQL, Cypher or XQuery. Registering only binds a name, so nothing is imported. Each language is a separate plug-in that translates queries into one internal plan format, which is why a SQL query can contain an XQuery fragment that reads values from the outer query and still be optimized as a whole.

Why it's ranked here

Cross-language queries inside one plan are rare, and the project documents the idea well: a thesis behind the design, per-language dialect pages that spell out what is missing, and an honest alternatives list naming faster options such as SQLite and DuckDB compiled to WebAssembly. ISC licensed, split into small installable packages, with a test workflow that runs on every push and pull request. It is a well-scoped research-grade engine, not a general database, and it says so plainly.

What's good

The limits are written down before you hit them. The SQL guide warns that a case mismatch in a column name returns a missing column rather than an error, and the Cypher guide warns that a label stored in the wrong attribute silently matches nothing. Data adapters let a language read rows shaped as maps or custom trees, not just plain objects. Secondary indexes on a column or expression are picked up by the optimizer automatically, and the graph package ships an index that resolves connected nodes through the graph itself.

Tradeoffs

It reads data and nothing else: no persistence, transactions, inserts or updates. The optimizer is rule-based rather than cost-based and execution is single-threaded, which the authors say shows on very large datasets. Each dialect is a subset. SQL has no window functions, no grouping sets and no star select; XQuery drops the type system; Cypher parses write clauses but refuses to plan them. Built-in function libraries are small, so expect to write extensions. Cypher support needs the Graphology library as a peer dependency.

How to use it well

Reach for it when an app already holds relational, tree and graph data in memory and you want declarative queries across them without copying into a database, for example filtering records by a count taken over an XML document. Install only the languages you use so the browser bundle stays small, register indexes for hot columns, and qualify column names in joins. If you need writes, persistence or raw speed on large tables, the project itself points you to SQLite or DuckDB builds instead.

Technical notes+

packages/core/src/db.ts: DortDB.query parses, builds a logical plan with the main language's logicalPlanBuilder, runs Optimizer.optimize, then executePlan, and when a query holds several statements only the last one is executed. executePlan returns an unmaterialized iterable for streaming, while query collects it with toArray. createIndex parses each expression, rejects any containing subqueries, and fills the index immediately by executing a projection over the source. packages/core/src/lang-manager.ts keys operators, functions, aggregates and castables in a Trie by [language, schema, name], falling back to a global scope and to lowercased names. packages/core/src/optimizer/index.ts exports rules for selection pushdown, subquery unnesting, projection merging, products-to-joins, join indices and index scans. .github/workflows/test.yml builds all packages, installs Playwright browsers and runs nx run-many -t test.

Observed

License
ISC, with the openCypher-derived Cypher grammar under Apache 2.0
Language
TypeScript
Packaging
npm packages: a core engine plus separate SQL, Cypher and XQuery language packages and a date/time extension
Interface
Library API; no CLI or server
Runtime
Browser and Node; XQuery in Node needs a DOM implementation such as jsdom
Data modification
None; read-only queries over in-memory data
CI
Test workflow in .github/workflows/test.yml runs on push and pull request

Read from README.md, package.json, roadmap.md, LICENSE, packages/core/package.json, packages/core/README.md, packages/core/src/db.ts, packages/core/src/lang-manager.ts, packages/core/src/extension.ts, packages/core/src/optimizer/index.ts, packages/lang-sql/README.md, packages/lang-cypher/README.md, packages/lang-xquery/README.md, packages/docs/docs/intro.md, .github/workflows/test.yml.

What it can do

  • Execute SQL queries against in-memory arrays, DOM trees, and graphs

    SQL query → Query results

  • Execute Cypher queries against in-memory arrays, DOM trees, and graphs

    Cypher query → Query results

  • Execute XQuery queries against in-memory arrays, DOM trees, and graphs

    XQuery query → Query results

  • Mix SQL, Cypher, and XQuery queries within a single query plan

    Multi-language query → Combined query results

  • Extend the engine with custom languages, functions, or optimizer rules

    Custom language/function/optimizer rule definitions → Extended query engine

  • Connect to data sources via data adapters

    Data source → Queryable data

  • Use secondary indices to speed up queries

    Index definition → Indexed data access

Tags

query-enginesqlcypherxqueryin-memory-databasejavascripttypescriptmulti-model

Tech Stack

Node.jsTypeScript

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.