Skip to content

Feat: Tables, Schemas - #7

Merged
Apakottur merged 5 commits into
mainfrom
feat/tables-diff
Jul 11, 2026
Merged

Feat: Tables, Schemas#7
Apakottur merged 5 commits into
mainfrom
feat/tables-diff

Conversation

@Apakottur

@Apakottur Apakottur commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What

Add initial support for schema and table diffs.

Apakottur and others added 3 commits July 11, 2026 18:00
Add table support to the schema differ, limited to whole-table create and
drop:

- introspect user tables (relkind='r', excluding system schemas) and their
  columns, ordered by attnum, with types from format_type
- CREATE TABLE when present in target only
- DROP TABLE when present in source only
- no-op when a table exists identically on both sides

Column-level diffing (adds/drops/type changes), constraints, indexes and
defaults are intentionally out of scope for this increment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RWGLHjhi8fHJ8cn9QwJw2v
Rename the full-database model from Schema to DbInfo and introduce a real
Schema type for Postgres namespaces (name + table_by_name keyed by table name),
resolving the 'schema' overload. Extensions stay at the DbInfo level since they
are unique per database by name; nesting them under a schema would misrepresent
SET SCHEMA as drop+create.

Add schema create/drop diffing:
- introspect user namespaces from pg_namespace (excluding pg_*,
  information_schema and extension-owned schemas)
- CREATE SCHEMA / DROP SCHEMA, ordered so schemas are created before their
  contents and dropped after them (creates -> extensions -> tables -> drops)

build_schema -> build_db_info, generate_schema_migration_sql ->
generate_migration_sql.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RWGLHjhi8fHJ8cn9QwJw2v
@Apakottur Apakottur changed the title feat: diff tables (create/drop) feat: diff tables and schemas (create/drop) + model restructure Jul 11, 2026
@Apakottur Apakottur changed the title feat: diff tables and schemas (create/drop) + model restructure Feat: Tables, Schemas Jul 11, 2026
@Apakottur
Apakottur merged commit 65bc15a into main Jul 11, 2026
12 checks passed
@Apakottur
Apakottur deleted the feat/tables-diff branch July 12, 2026 01:24
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