Skip to content

feat(connections): add desktop DatabaseType constants to TableProModels (Phase 1 prep)#1494

Merged
datlechin merged 1 commit into
mainfrom
refactor/databasetype-core-parity
May 29, 2026
Merged

feat(connections): add desktop DatabaseType constants to TableProModels (Phase 1 prep)#1494
datlechin merged 1 commit into
mainfrom
refactor/databasetype-core-parity

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Phase 1 (R-002) step 8.1: bring the authoritative TableProModels.DatabaseType to constant parity with the desktop app's duplicate, so the desktop type can be removed in a later PR without breaking call sites. Package-only and additive.

  • Adds the 3 constants the desktop type has but the package lacked: .cockroachdb ("CockroachDB"), .scylladb ("ScyllaDB"), .turso ("Turso").
  • Leaves the built-in allKnownTypes list at 17 (mobile's type picker is unchanged); the new constants are intentionally outside it.
  • Does not touch allKnownTypes (static), pluginTypeId/iconName (hardcoded). Mobile and the TableProCore library modules depend on those as-is.

Risk Addressed

  • R-002: duplicate DatabaseType definitions (groundwork; full consolidation is the follow-up).

Seam note for the follow-up (8.2)

The desktop type's allKnownTypes, pluginTypeId, and iconName are registry-driven; the package's are static/hardcoded. Swift extensions can't override static/instance members, so when the desktop adopts this type it must install the registry-driven behavior via a resolver hook (or distinct names), not as overrides. The desktop .bigQuery vs package .bigquery constant-name mismatch is reconciled there too.

Verification

  • swift test --package-path Packages/TableProCore (61 tests pass; new DatabaseType cases included)
  • scripts/audit-refactor-health.sh --check (contract-drift gate clean)
  • Codable form unchanged (string rawValue), so persisted connection JSON is unaffected.

Notes

  • ABI bump required: no.
  • Docs updated: no.
  • macOS app untouched (it does not import TableProModels yet).

@datlechin datlechin merged commit 7fec41a into main May 29, 2026
5 checks passed
@datlechin datlechin deleted the refactor/databasetype-core-parity branch May 29, 2026 18:36
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