Feat: Tables, Schemas - #7
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add initial support for schema and table diffs.