Skip to content

refactor: share the database endpoint picker and the create-database form - #2566

Merged
datlechin merged 2 commits into
mainfrom
refactor/share-database-endpoint-and-create-database-form
Aug 28, 2026
Merged

refactor: share the database endpoint picker and the create-database form#2566
datlechin merged 2 commits into
mainfrom
refactor/share-database-endpoint-and-create-database-form

Conversation

@datlechin

Copy link
Copy Markdown
Member

Two shared-code changes pulled out of the work on #2487, so that issue's own branch reviews as a
feature rather than as a feature plus a rename. Nothing here changes behaviour.

CompareSyncEndpoint becomes DatabaseEndpoint

The type is "one database, on one connection, named well enough to act on". Compare & Sync named it
first, but it answers a question any cross-database operation asks, and the copy work in #2487 needs
the same answer. It moves to Core/Database/, and its chooser, which walks connection then database
then schema, moves to Views/Components/ as DatabaseEndpointPicker.

CompareSyncEligibility stays behind in Core/Compare/: whether a driver reports enough for a
comparison is Compare's question, not a shared one.

Pure rename, compiler-verified. The endpoint's own tests move with it to
TableProTests/Core/Database/.

The create-database form's rules become shared and testable

CreateDatabaseSheet held the whole form contract inline: which fields are visible, which options
belong to which group, what resets when a grouped field's source changes, and which answers are
stale enough that they must not be submitted. A second caller either duplicates that or loses it.

It splits into CreateDatabaseFormRules, which is pure, and CreateDatabaseOptionsView, which
renders it. The sheet keeps its own state and loses about 110 lines.

The rules had no tests. They have 12 now, including the two that matter and were never asserted:

  • a collation from the character set the user just moved away from is reset rather than submitted as
    a pair the server refuses
  • a hidden field's answer is stale rather than chosen, so it never reaches CREATE DATABASE

What I built and tested

Step Verdict
verify.sh build PASS
verify.sh test (touched suites) PASS, 45/45
verify.sh lint TablePro TableProTests 0 violations

verify.sh plugins and verify.sh abi were not run and are not needed: nothing under Plugins/
changed.

No CHANGELOG entry: nothing user-facing changes, and the rename is internal.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 1f725bb into main Aug 28, 2026
11 of 12 checks passed
@datlechin
datlechin deleted the refactor/share-database-endpoint-and-create-database-form branch August 28, 2026 15:59
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