Port 11 behaviour fixes from go-gorm/sqlite (parity with upstream) - #153
Open
davidpavlovschi wants to merge 1 commit into
Open
Port 11 behaviour fixes from go-gorm/sqlite (parity with upstream)#153davidpavlovschi wants to merge 1 commit into
davidpavlovschi wants to merge 1 commit into
Conversation
Ports every behaviour-changing upstream commit since 7544227, verified against the modernc backend: - 13be5e3 (go-gorm#236): preserve indexes, triggers, table options and views across table rebuilds - d450667 (go-gorm#235): HasColumn matches exactly via pragma_table_info - 69c4707 (go-gorm#230): generated (computed) columns via the generated tag - fc0cfd3 (go-gorm#207): parse CHECK/CONSTRAINT/FOREIGN KEY table-level lines - 5406e41 (go-gorm#198): case/whitespace-tolerant constraint matching - 02b8e06 (go-gorm#193): parseAllColumns state machine for composite keys - 7230345 (go-gorm#229): disable foreign keys during DropColumn - 6f07b51: don't overwrite caller-registered clause builders - 75dbf08 (go-gorm#222): accept tab between column name and type - bbca3b3 (go-gorm#185): exported Config and New(Config) constructor - 5df1f76 (go-gorm#219): remove stray Debug() from GetIndexes migrator.go, ddlmod.go and ddlmod_parse_all_columns.go are taken from upstream verbatim; sqlite.go is hand-merged to keep this fork's imports, DriverName, and its error-code-based Translate. Upstream's test files for these paths are ported unchanged. Refs #152
Collaborator
Author
|
Note on the red CI: every ubuntu lane passes (1.19/1.20/1.21). The failures are environmental — Go ≤1.21 binaries abort with |
Collaborator
Author
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.
Delivers the parity plan from #152. Every behaviour-changing upstream commit since
7544227(2024-03-09) is ported and verified against the modernc backend — the full table with per-fix symptoms is in the audit comment.What's deliberately kept divergent (and why): the glebarez/go-sqlite + modernc imports,
DriverName = "sqlite", and this fork'sTranslate— ours type-switches on real sqlite error codes instead of upstream's JSON round-trip, which is the better implementation.Verification:
migrator.go,ddlmod.go,ddlmod_parse_all_columns.goare upstream-verbatim (no driver references exist in them);sqlite.gois hand-merged (~65 lines). Upstream's test files for these paths (ddlmod_test.go,ddlmod_parse_all_columns_test.go,migrator_test.go,generated_test.go) are ported unchanged and pass: 70 tests run, all green, both on the current pinned deps (gorm 1.25.7 / modernc.org/sqlite 1.23.1) and on bumped ones (gorm 1.31.2 / modernc.org/sqlite 1.55.0).gofmtclean.Not in this PR (follow-ups, per the plan in #152): go.mod dependency bumps, CI matrix bump to Go 1.24–1.26, README parity note.
Refs #152