added typeaheead and introspetion

This commit is contained in:
Mark Gregory
2026-10-19 09:24:12 +01:00
parent c102bef2a6
commit 4cbb5624af
8 changed files with 836 additions and 4 deletions
+41
View File
@@ -0,0 +1,41 @@
# DBSyn — Phase 71: Release readiness
## Scope
This is a **release candidate preparation**, not a certified production release.
The Xcode project now declares a bundle version (1.0.0 / build 71), sets the
Finder app icon file explicitly, and removes a forced NSTextView cast in the
SQL editor initialization path. The previous Phase 70 features remain in place.
## Required verification on a Mac
- [ ] Clean Debug and Release builds in Xcode with no compiler errors.
- [ ] Verify the About panel shows 1.0.0 and Finder displays the DBSyn icon.
- [ ] Test light, dark, and system appearance across all settings and editors.
- [ ] Connect to local and remote MySQL with supported authentication methods.
- [ ] Test `USE AAMEDIUK; SELECT * FROM ADCUSERS;` as sequential statements.
- [ ] Introspect tables and views; verify metadata survives a relaunch.
- [ ] Create, alter, and drop a test table; verify cache refresh detects changes.
- [ ] Test type-ahead table/column suggestions and keyboard selection repeatedly.
- [ ] Test query history, saved queries, EXPLAIN, and query diagnostics.
- [ ] Verify read-only schema/data comparisons and generated migration previews.
- [ ] Verify CSV import/export, backup history, checksum validation, and restore confirmation.
- [ ] Test slow or interrupted connections and queries with large result sets.
- [ ] Verify accessibility, keyboard navigation, window resizing, and scrolling.
- [ ] Verify no passwords are stored in plaintext outside Keychain.
- [ ] Archive with Developer ID signing and hardened runtime.
- [ ] Notarize and staple the exported app; assess with Gatekeeper.
- [ ] Create the DMG, notarize/staple it, verify both app and disk image icons.
- [ ] Install on a clean Mac and confirm first launch succeeds.
## Release blockers
A successful Swift syntax parse or ZIP check **does not** establish a successful
macOS build, functional MySQL interoperability, or a notarized distribution.
Do not call the release production-ready until the checks above pass.
## Distribution
This package contains the source project and documentation only. No new build,
run, or release scripts are included. The existing direct-distribution process
should be verified separately on macOS.
+19
View File
@@ -0,0 +1,19 @@
# Phase 72 — Reviewed row editing
Select a row in the Result Grid and choose **Edit Selected Row…**. Edit values in the sheet, inspect the generated `UPDATE`, then select **Apply SQL Changes**. The sheet also supports copying the SQL without executing it.
## Scope and safeguards
- Enabled only for a simple `SELECT * FROM <table> [LIMIT …]` result with matching introspection metadata for a **base table** and a primary key. Joins, arbitrary projections and views are read-only.
- Primary-key columns are read-only. A primary key is used in the `WHERE` predicate; changed columns' original values are also checked to detect concurrent changes.
- Uses `UPDATE … LIMIT 1`; the SQL is shown before execution and never applied automatically.
- MySQL values are encoded as hexadecimal UTF-8 expressions to avoid quote escaping and SQL injection from entered text.
- Nullable fields displaying `NULL` are blocked when they are part of the update or predicate because the existing MySQL protocol collapses SQL NULL into the string `NULL`.
- The initial implementation edits values as text. Explicit NULL assignment, binary/BLOB editing, INSERT, DELETE and arbitrary joined-result editing are not supported.
- Refreshes the original query after successful execution; verify affected-row counts and the refreshed result. An UPDATE can affect zero rows if a concurrent change occurred.
## Verification on macOS
Build in Xcode and test a base table with a primary key, including quotes and backslashes in edited text, multiple rows, changed data since SELECT, read-only views, and a table without a primary key. Verify System/Light/Dark appearance.
No build or release scripts are included.
+11
View File
@@ -0,0 +1,11 @@
# Phase 73.1 — Visual Schema Diagrams
Open the Schemas navigator, right-click a database, and select **Generate Schema Diagram…**.
The diagram uses cached introspection for tables, views and columns. Foreign-key edges are loaded read-only from `information_schema.KEY_COLUMN_USAGE`. Drag tables to position them, use zoom buttons, search, and toggle views. Layouts persist per connection and database in local preferences.
Run Introspection first if the schema cache is empty. Refresh reloads introspection and relationships. No schema-changing SQL is executed.
Limitations: automatic grid layout rather than graph optimisation; first 10 columns are shown per node; diagram export and multi-diagram management are deferred to Phase 73.2/73.3.
Validation: Swift syntax parsing and ZIP integrity only. Full Xcode build and runtime test are required on macOS.
@@ -0,0 +1,20 @@
# DBSyn Phase 73.2 + 73.3 — Diagram management, printing and export
## Included
- Multiple named diagram layouts for each connection and database, persisted using UserDefaults.
- Diagram picker, create and delete actions. Deleting a layout does not alter database objects.
- Professional, print-oriented rendering on a white background with navy headings, blue table cards, violet view cards, alternating row stripes, and subdued relationship lines.
- PDF export using AppKit's vector PDF generation.
- PNG export at diagram dimensions.
- SVG export as scalable editable XML artwork.
- Native macOS Print dialog, with automatic fit-to-page pagination settings.
- Full column lists in exports (screen preview still limits to 10 columns per node).
## Use
Open **Generate Schema Diagram…** from a database context menu. Choose or create a named diagram with the Diagram picker and plus button. Arrange tables, then choose **Export / Print** > **Export PDF…**, **Export PNG…**, **Export SVG…**, or **Print…**.
## Notes
Diagram exports are read-only and do not modify MySQL schema or data. PDF and SVG are vector-based. Relationship links are generated from MySQL foreign keys, when available. Printing is through the system print dialog. The application must be compiled and exercised on macOS for final validation.