Skip to content

fix(v4): accept negative index and foreign key options - #1779

Open
dajiaohuang wants to merge 1 commit into
dimitri:mainfrom
dajiaohuang:repostew/20261016-v4-negative-db-options
Open

dajiaohuang wants to merge 1 commit into
dimitri:mainfrom
dajiaohuang:repostew/20261016-v4-negative-db-options

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

The v4 LOAD DATABASE grammar rejects create no indexes and no foreign keys, although the v3 SQLite parser accepts both and the SQLite reference documents create no indexes. This prevents otherwise valid SQLite load commands from running.

References #1773 and #1765. This addresses the documented plural indexes spelling, not the separate data only behavior mentioned in a comment on #1773.

Change

Add the two negative grammar productions and translate them into explicit :create-indexes false / :foreign-keys false options. These override the existing database defaults; no execution/default-policy change is needed. Add parser regression cases for the positive options, each negative option, and both together.

Validation

Against main 231ab86778ca5ffd7de40878714760c8b4860cdf, the regression suite has 6 failures; with the fix, the parser suite passes 43 tests / 155 assertions, 0 failures / 0 errors.

Also exercised the public CLI with the changed grammar/AST/parser and checkout core/CLI explicitly loaded, using the matching official v4-dev JAR as the dependency classpath (Java 26). Against a fresh task-owned PostgreSQL 17.6 cluster and a self-authored tiny SQLite database with two tables, two rows each, a secondary index and a foreign key:

  • Positive options: exact rows, 3 indexes (2 PK + secondary), 1 FK.
  • WITH create no indexes, no foreign keys: exact rows, 0 indexes and 0 FK constraints, with default table creation still working.

All HOME/config/passfile/output and database paths were isolated. Parser tests used an empty MySQL option-file lookup instead of host configuration. No real migration, full cross-database suite, rebuilt uberjar, or CI result is claimed.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant