Skip to content

fix: SQLite foreign keys, mock version, import deps - #927

Merged
EVWorth merged 6 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h
Oct 30, 2026
Merged

EVWorth merged 6 commits into
mainfrom
claude/hopeful-bardeen-1k4d1h

Conversation

@EVWorth

@EVWorth EVWorth commented Oct 30, 2026

Copy link
Copy Markdown
Owner

The leftovers from the UX review. The implementer-rust lane did the code, and I added one docs commit.

Closes #924

Changes

  • Mock app version. The mock now reads its app version from package.json, not a hardcoded 1.3.0. Both the app version and the updater's current version use it.
  • SQLite foreign keys. New command sqlite_get_foreign_keys, built on pragma_foreign_key_list(?1) with the table name as a bound parameter. It returns the same ForeignKeyInfo that MySQL's get_foreign_keys returns.
    • SQLite discards constraint names, so each key gets the name fk_<table>_<id>.
    • When a key names no parent columns, the parent table's primary key columns are used.
    • The command is wired through tauri-api.ts and dataSourceFor, has a mock handler (the SQLite fixture gains a note_tags table with a foreign key), and is listed in ARCHITECTURE.md §5.
  • ImportDialog. handlePickFile no longer turns off the hook-dependency lint check.
    • The check was hiding a real problem: the function was declared before the two callbacks it calls, so listing them as dependencies threw at render.
    • It is now declared after them, with its full dependency list.
  • AGENTS.md: close issues with one keyword per issue. GitHub reads Closes #1, #2 as closing only Fix: sidebar schema selection, explain tab, autocomplete, run/explain flow #1.

Tests

  • Rust tests for SQLite foreign keys:
    • a composite key with columns out of order;
    • every ON UPDATE / ON DELETE action;
    • a key with no parent columns;
    • a table with no keys, and an unknown table;
    • a table name containing a quote and a semicolon;
    • an unknown connection.
  • Frontend tests for the datasource routing, the store, tauri-api.ts, the mock data, and the mock version.
  • cargo fmt, clippy -D warnings, cargo test -p mas-sqlite and -p sqlpilot pass.
  • npm run test:unit passes (3731 tests). The ImportDialog browser test passes. Lint shows 0 errors and no new warnings. type-check, dprint and check-documented-commands.sh are clean.

Generated by Claude Code

Adds sqlite_get_foreign_keys, built on PRAGMA foreign_key_list, and
routes the SQLite data source's getForeignKeys to it instead of an empty
list. It returns MySQL's ForeignKeyInfo shape. SQLite keeps no constraint
names, so each key is named fk_<table>_<id>; a key that names no parent
columns resolves to the parent's primary key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
The lint check was off because handlePickFile was declared before the
parseCsvContent and loadTables callbacks it calls, so listing them threw
in the temporal dead zone. Declare it after them and list its real deps.

Closes #924

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
@EVWorth
EVWorth merged commit d6ba5d2 into main Oct 30, 2026
12 checks passed
@EVWorth
EVWorth deleted the claude/hopeful-bardeen-1k4d1h branch October 30, 2026 11:48
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
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.

chore: small leftovers from the UX review

2 participants