Tracker: Multi-table SQL — catalogs, external sources and relational queries

Open
#590 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
sql, typescript
Domain
backend, database

Research direction

This tracker spans four substantial implementation PRs, and the first is already linked as #591. Start by reading #591 and the current SQL package API, especially queryArrowSQL(sql, tables, options); identify which delivery phase remains open before choosing a bounded task. Done means completing that phase’s listed implementation, focused tests, public documentation and CI gates.

Written by the indexing model from the issue text.

Description

Status and scope

Experimental. Proposed APIs and SQL extensions may change. Default SQL schema: data. Keep functionality in @math.gl/sql without new micro packages or nested public subpaths. Arrow owns physical table/type utilities; SQL owns catalogs and execution; community panels own UI.

Integration contract

loaders.gl and deck.gl are primary consumers. They feed declarative table definitions into the catalog: table name, SQL namespace (default data), optional Arrow schema and descriptive metadata, plus resident Arrow data or a lazy materializer. Preserve full Arrow type schemas for community panels. Definitions are independent of query-time state and contain no renderer or loader dependency. Consumers own format detection, credentials, loading, connection lifetime and any persistent cache. Validate this contract with dependency-free mocks of both integration patterns and concrete adapter examples.

Delivery: four substantial implementation PRs

Each PR includes public TSDoc, focused tests and its own documentation. Preserve queryArrowSQL(sql, tables, options).

1. Catalog, external sources and discovery

Implementation PR: #591 (experimental; in review).

  • SQLCatalog accepting object/Map registrations; explicit schemas with default data; structured identifiers and quoted-name behavior.
  • Registration/removal/replacement, primary-table selection, metadata notifications and clear resolution errors.
  • Omitted FROM uses the primary table; explicit FROM wins. No inferred primary. Constant SELECT without a primary produces one row; with a primary, one row per source row.
  • Arrow Table or asynchronous provider with read({signal}) and optional getSchema({signal}); query/queryAsync with shared semantics.
  • Resolve referenced sources only, once per query; snapshot bindings; cancellation; source-specific errors; schema validation.
  • No implicit persistent cache or cross-source transactional guarantee. Metadata browsing must not materialize sources.
  • Structured schema discovery plus SHOW SCHEMAS, SHOW TABLES [FROM schema], DESCRIBE schema.table with stable Arrow result schemas.
  • URL and DuckDB adapter examples without runtime dependencies.
  • Tests: names/quotes, primary behavior, empty tables, registration, unused sources, read deduplication, cancellation/errors, declared-schema mismatch.
  • Experimental API documentation and catalog/external-source quickstart.
2. Composable execution and joins
  • Separate parsing, binding/type validation, relational planning, source resolution and execution.
  • Stable field identities; multiple joins; INNER/LEFT/RIGHT/FULL OUTER/CROSS; composite equality keys; residual ON predicates; USING; qualified wildcards.
  • Correct ambiguous-column errors, outer nullability, self-joins and exact integer keys.
  • Nonrecursive WITH and FROM subqueries with lexical scope and cycle rejection.
  • Cancellation and configurable intermediate-row limit; document that this is not a memory budget.
  • Hash joins; clear rejection of unsupported general non-equality joins.
  • Tests: duplicate/null keys, empty inputs, chained outer/self joins, scope, ON versus WHERE; focused performance checks.
  • Join/composition guide and supported-predicate reference.
3. Set operations and type reconciliation
  • UNION ALL/UNION DISTINCT, INTERSECT/EXCEPT with ALL variants, SELECT DISTINCT.
  • Compound-query precedence, parentheses, branch/final ordering and pagination.
  • Positional column matching, first-input names, common types and combined nullability; reject silent precision loss.
  • Dictionary logical-value equality; explicit temporal/decimal/nested-type compatibility.
  • Shared collision-safe row hashing/equality; explicit null/NaN/signed-zero and multiplicity semantics.
  • Preserve compatible UNION ALL batch concatenation.
  • Tests: duplicates/nulls, dictionaries/chunks, precision limits, incompatible types, precedence and algebraic identities; allocation/performance checks.
  • Set-operation guide and type compatibility reference.
4. Community panels and integrated documentation
  • Catalog panel: schemas/tables/fields, primary selection, external/resident status, explicit inspection/refresh and quoted identifier insertion.
  • Schema panel: nested Arrow types, nullability, dictionary types, timestamps/decimals and expandable metadata.
  • Framework-independent metadata APIs; existing community panels system; no automatic source materialization.
  • Integrated example: related tables in data, second schema, lazy source, joins/CTEs/sets/discovery, cancellation and readable errors.
  • Keyboard/mobile checks and metadata lifecycle tests.
  • Full docs pass for ease of learning, reasonable brevity, completeness and tone; runnable examples, public API coverage, rendered pages and links.
  • Single SQL support matrix; accurate worker/streaming limitations and experimental labels.

Gates

Current-head CI/coverage, package exports/declarations, relevant Arrow compatibility, addressed reviews, no DuckDB/loaders.gl/UI runtime dependency. Merge in dependency order. APIs/examples must clearly distinguish proposed experimental functionality from existing behavior.

Follow-up scope

Window functions, correlated/recursive queries, UNNEST, general non-equality joins, pushdown, persistent materialized views and transactional guarantees. Query parameters should preserve the existing parser hook and receive a separately specified safe value-binding API if needed.

Dominant language
TypeScript
Stars
72
Forks
7
Avg merge
3h 57m
Merged PRs (30d)
404

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/math.gl

All issues in visgl/math.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.