Skip to content

fix(schema): return get_schema_snapshot as the host TableSchema array - #10

Merged
jonaspm merged 2 commits into
mainfrom
fix/er-diagram-schema-snapshot
Oct 26, 2026
Merged

jonaspm merged 2 commits into
mainfrom
fix/er-diagram-schema-snapshot

Conversation

@jonaspm

@jonaspm jonaspm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Problem

Opening the ER diagram on a libSQL connection always failed with
Failed to load diagram: invalid type: map, expected a sequence.

Tabularis deserializes get_schema_snapshot straight into Vec<TableSchema>
(src-tauri/src/plugins/driver.rs), but this plugin returned a
{tables, columns, foreign_keys} envelope. plugins/PLUGIN_GUIDE.md and the
create-plugin Rust template both specify an array of
{name, columns, foreign_keys}.

Fix

  • get_schema_snapshot now returns one {name, columns, foreign_keys} entry
    per table (schema_snapshot_for); an empty schema returns [].
  • Regression tests cover the array shape, the required per-entry keys, FK
    fields, and the empty-schema case.
  • just dev-install / uninstall now target the kind-first
    plugins/drivers/libsql bundle on Linux, macOS and Windows. Tabularis
    resolves drivers/<id> before flat bundles, so the old flat path was
    shadowed by an installed copy.
  • Version 1.0.3 (Cargo.toml, Cargo.lock, .tabularium, CHANGELOG.md).

Verification

  • cargo test --locked --all-targets: 100 passed (2 new)
  • just lint (clippy with -D warnings) and just fmt: clean
  • Manual stdio call against demo/tabularis_demo.db returns "result":[{...}],
    confirmed with the installed plugin binary as well.

Tag v1.0.3 after merge to run the release workflow.

The ER diagram deserializes get_schema_snapshot straight into
Vec<TableSchema>, so the {tables, columns, foreign_keys} envelope failed
with "invalid type: map, expected a sequence" and the window only ever
showed a load error. Return one {name, columns, foreign_keys} entry per
table; an empty schema is now [].

Also point just dev-install/uninstall at the kind-first
plugins/drivers/libsql bundle, since the host resolves drivers before
flat bundles and shadowed the old flat path.

Bump to 1.0.3.
@kilo-code-bot

kilo-code-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

Kilo Code Review could not run — your account is out of credits.

Add credits or switch to a free model to enable reviews on this change.

- README: fix the pagination claim (no total row count), document file:
  URIs, ssl_mode scheme rules, triggers and the snapshot shape that powers
  the ER diagram; move install steps to plugins/drivers/libsql and add the
  release-archive path.
- AGENTS.md: add the project guide, including the dev-install location and
  the get_schema_snapshot contract.
- CHANGELOG: point the 1.0.3 link at its release tag, matching older entries.
@jonaspm
jonaspm merged commit 614c30f into main Oct 26, 2026
2 of 3 checks passed
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