You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(schema): live DB schema introspection for Postgres, MySQL, SQLite (#448)
Adds pkg/schema/db with Loader interface and DatabaseSchema/Table/Column/
Index/ForeignKey types for querying live database schema metadata.
Dialect-specific implementations:
- pkg/schema/postgres: information_schema + pg_catalog queries
- pkg/schema/mysql: information_schema queries
- pkg/schema/sqlite: PRAGMA commands (pure Go, no cgo)
Also adds gosqlx.LoadSchema() top-level convenience wrapper and
integration tests using testcontainers-go v0.32.0 for Postgres/MySQL.
SQLite tests run without Docker and always pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## [Unreleased]
9
9
10
10
### Added
11
+
-**Live schema introspection** (`pkg/schema/db`): New `Loader` interface and `DatabaseSchema`/`Table`/`Column`/`Index`/`ForeignKey` types for querying live database metadata
12
+
-**PostgreSQL schema loader** (`pkg/schema/postgres`): Introspects tables, columns (with primary/unique flags), indexes, and foreign keys via `information_schema` and `pg_catalog`
13
+
-**MySQL schema loader** (`pkg/schema/mysql`): Introspects tables, columns, indexes, and foreign keys via `information_schema`
14
+
-**SQLite schema loader** (`pkg/schema/sqlite`): Introspects tables, columns, indexes, and foreign keys via PRAGMA commands (pure Go, no cgo required)
15
+
-**`gosqlx.LoadSchema()`** top-level convenience wrapper for dialect-agnostic schema loading
16
+
- Integration tests using `testcontainers-go` v0.32.0 for PostgreSQL and MySQL loaders
11
17
-**MariaDB dialect** (`--dialect mariadb`): New SQL dialect extending MySQL with support for SEQUENCE DDL (`CREATE/DROP/ALTER SEQUENCE` with full option set), temporal tables (`FOR SYSTEM_TIME`, `WITH SYSTEM VERSIONING`, `PERIOD FOR`), and `CONNECT BY` hierarchical queries with `PRIOR`, `START WITH`, and `NOCYCLE`
0 commit comments