Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix-sqlite-collation-11907#12028

Draft
harshang03 wants to merge 1 commit intotypeorm:masterfrom
harshang03:fix/sqlite-collation-11907
Draft

fix-sqlite-collation-11907#12028
harshang03 wants to merge 1 commit intotypeorm:masterfrom
harshang03:fix/sqlite-collation-11907

Conversation

@harshang03
Copy link

Description of change

This change fixes SQLite losing column collations during loadTables() by reading COLLATE clauses from the stored table SQL. The query runner now parses column definitions in sqlite_master.sql and assigns the extracted collation to TableColumn.collation, preserving NOCASE (and other collations) across schema syncs. Driver-specific SQL normalization ensures consistent parsing for both sqlite and sqljs.
Why needed:
Without this, a table rebuilt during synchronize() drops collations because they are not captured from the existing table definition.
How verified:
Code inspection of loadTables() and schema sync flow; no automated tests added.
Current behavior:
Collations (e.g. COLLATE NOCASE) are lost after schema changes.
New behavior:
Collations are preserved when loadTables() reads the current schema.
Fixes #11907

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated tests validating the change (tests/**.test.ts)
  • Documentation has been updated to reflect this change (docs/docs/**.md)

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this PR still valid or is it abandoned?

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.

sqlite: loadTables method unable to get collation

2 participants