Repository navigation
fix(sqlite): read the definition of the first column when introspecting a table - #8518
Merged
B4nan merged 2 commits intoNov 4, 2026
Conversation
…ng a table The column definitions were matched with a regex that requires a comma before the column name, so the first column of a `create table` statement was never matched. Its collation, inline check (including enum items) and generated expression were lost, which made `getUpdateSchemaSQL()` rebuild the table right after `schema.create()` and made introspection throw for a generated first column.
B4nan
approved these changes
Nov 3, 2026
B4nan
enabled auto-merge (squash)
November 4, 2026 00:33
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8518 +/- ##
===========================================
+ Coverage 80.10% 99.66% +19.56%
===========================================
Files 293 293
Lines 32316 32349 +33
Branches 8725 8735 +10
===========================================
+ Hits 25886 32242 +6356
+ Misses 6421 103 -6318
+ Partials 9 4 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
SQLite introspection finds each column's definition in the
create tableSQL with a regex that expects a comma before the column name. The first column has none, so its collation, inline check (including enum items) and generated expression were never read. The entity generator dropped them, introspection threwCannot read properties of undefined (reading 'definition')when the first column was generated, and a collated or enum primary key (or a pivot FK column that copies its collation) madegetUpdateSchemaSQL()return a table rebuild right afterschema.create()instead of an empty string:The regex now also matches the column at the start of the column list. Other columns still need the leading comma.