Skip to content

Lift single-file SQL limitations (JOIN, GROUP BY, subqueries, aggregates) #571

Done

Description

@MPCoreDeveloper

Summary

.scdb single-file mode does not support JOIN, GROUP BY, subqueries, aggregates, DELETE without WHERE and other advanced SQL (see docs/storage/SINGLE_FILE_SQL_LIMITATIONS.md). SCDMS must currently block these with an explanation, which limits the studio on single-file databases.

Needed

  • Investigate lifting (a subset of) these limitations, prioritising JOIN and simple aggregates/subqueries.
  • Until then, keep the documented limitation list authoritative so SCDMS can show accurate capability reasons.

References

  • SharpCoreDB docs/storage/SINGLE_FILE_SQL_LIMITATIONS.md.
  • SCDMS: docs/product-ui-roadmap.md §7 (single-file limitations).

Activity

  1. added a commit that references this issue on Dec 6, 2026
  2. MPCoreDeveloper commented on Dec 6, 2026

    @MPCoreDeveloper
    OwnerAuthor

    This issue's premise is stale — measured, not read

    I re-derived the claim by executing the whole matrix on 2026-12-06 against a .scdb file and a directory database
    side by side (same DDL, same rows, same statements). Single-file mode is not missing JOIN, GROUP BY, subqueries,
    aggregates or DELETE without WHERE: it shares the SqlParser with directory mode, and these all return the same
    rows in both modes — measured, not inferred:

    Statement Directory .scdb
    INNER JOIN / LEFT JOIN / RIGHT JOIN / FULL OUTER JOIN same rows same rows
    GROUP BY (+ COUNT/SUM), HAVING same rows same rows
    subquery in FROM, subquery in WHERE (IN (SELECT …)) same rows same rows
    SELECT AVG(total), COUNT, MIN, MAX over a clean column same rows same rows
    DELETE FROM t (no WHERE), UPDATE … (no WHERE) same rows same rows
    SELECT *, WHERE (=, AND/OR), ORDER BY, LIMIT/OFFSET, DISTINCT, LIKE, IN, BETWEEN, IS NULL same rows same rows
    window functions (ROW_NUMBER() OVER …), UNION, CASE same rows same rows

    So there is nothing to "lift" for the items this issue lists.

    What is genuinely still missing (different list)

    Executing the matrix produced a new, precise list; it is filed as #580 with the evidence and the workarounds, and
    docs/storage/SINGLE_FILE_SQL_LIMITATIONS.md now documents it as Verified gaps (the file previously claimed several
    things that are not true — five rows were wrong and are corrected):

    1. a view cannot be queried in either mode (SELECT … FROM <view> → Table <view> does not exist);
    2. WHERE predicates that meet a NULL disagree between the modes and both depart from SQL;
    3. SUM/AVG/MIN/MAX over a column containing a NULL throw InvalidCastException;
    4. sqlite_master answers on directory only, sqlite_schema on neither.

    The documentation half of this issue is done

    docs/storage/SINGLE_FILE_SQL_LIMITATIONS.md is rewritten from the measurement: every row of the DDL/DML/SELECT and
    introspection matrices was executed on both modes on 2026-12-06, the five wrong rows are corrected
    (INSERT OR IGNORE/INSERT OR REPLACE, sqlite_master/sqlite_schema, BEGIN/COMMIT/ROLLBACK,
    STORAGE = COLUMNAR, EXPLAIN), the broken duplicate FluentMigrator table is removed, and the file states its method
    and date so the next reader can re-run it. SCDMS can show accurate capability reasons from that file, and from
    information_schema, today.

    Closing this as done: the investigation found the premise stale, the capability list is now authoritative, and the real
    remaining gaps are scoped in #580.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions