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
{{ message }}
Repository navigation
Commit 93c91ec
Browse filesBrowse the repository at this point in the historyBrowse files
fix(csharp): pre-merge gate on introspect — bug fixes + simplification
code-reviewer found 1 MAJOR + 4 actionable MINOR. All fixed with new test
coverage; code-simplifier consolidated duplication. 524 tests green throughout.
Fixes:
- M1 (dead code): MigrateCommand.cs blocked-message no longer Replace("Change+","")
— Type.Name on a nested record is already the short form.
- M2.1 (PG10+ identity): PostgresIntrospect.ColumnsSql now selects is_identity,
and ReadColumnsAsync treats is_identity='YES' as IdentityKind.Increment in
addition to legacy nextval(...) / bigserial detection. (M2.2/M2.3 — diff-side
Identity comparison and PostgresSchema GENERATED ... AS IDENTITY DDL — are
larger reconciliation work, deferred and recorded in memory.)
- M3 (time→Text pinned): PgTypeToSqlType now has an explicit time / time without
time zone / timetz / time with time zone arm returning SqlType.Text (matches
TS contract). Was previously an accidental fallthrough to the catch-all.
- m3: ReadIndexesAsync / ReadForeignKeysAsync drop the misleading post-mutate
tuple re-stores — List<T> is a reference type, mutating in place is enough.
Comments rewritten to reflect the actual semantics.
- m4: FakePgIntrospector.OnPrimaryKey matches the narrower "'PRIMARY KEY'"
anchor so a future SQL comment can't accidentally route through it.
- m6: NpgsqlIntrospector.ConnectAsync disposes the connection if OpenAsync
throws (no half-open leak).
- m7: Program.RunIncrementalMigrate wraps Connect in try/catch and surfaces
Npgsql failures as "could not connect to Postgres: <message>" + exit 1
instead of an unhandled stack trace.
New tests (M4 + M5):
- Composite FK preserves column pairing + per-side referential actions.
- Non-unique single-column + multi-column unique indexes both round-trip.
- Serial detected via udt_name when the sequence default is absent.
- PG10+ GENERATED ... AS IDENTITY columns detected via is_identity='YES'.
Simplifications (output preserved):
- Merged "float4|real|float8|double precision" into one Real branch in PgTypeToSqlType.
- Replaced the six udt-name OrdinalIgnoreCase chain with a static HashSet lookup.
- Added a ColRow(...) test helper that names every information_schema.columns
field at the call site with sensible defaults — cuts repeated boilerplate
across the orchestrator tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments