Skip to content

fix(migrate): read SQLite UUIDs stored as text, not just blobs#38

Merged
AshDevFr merged 1 commit into
mainfrom
fix/migrate-sqlite-text-uuids
Jul 5, 2026
Merged

fix(migrate): read SQLite UUIDs stored as text, not just blobs#38
AshDevFr merged 1 commit into
mainfrom
fix/migrate-sqlite-text-uuids

Conversation

@AshDevFr

@AshDevFr AshDevFr commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Exporting or copying from a real SQLite database failed with "invalid length: expected 16 bytes, found 36" when its UUID columns were stored as 36-character hyphenated text rather than 16-byte blobs — a format written by older toolchains. The reader decoded UUIDs strictly as blobs, so any such database was unreadable.

When the source is SQLite, read each table through a query that coerces UUID columns back to blobs regardless of how they were stored (text is converted, blobs pass through untouched), so both formats decode. The write path already adapts to the destination, so every source/destination combination now produces a correct result, and importing a text-UUID database canonicalizes it in the process.

Adds a regression test for text-stored UUIDs and an export/import matrix covering every SQLite/PostgreSQL source-destination pair.

Exporting or copying from a real SQLite database failed with
"invalid length: expected 16 bytes, found 36" when its UUID columns were
stored as 36-character hyphenated text rather than 16-byte blobs — a
format written by older toolchains. The reader decoded UUIDs strictly as
blobs, so any such database was unreadable.

When the source is SQLite, read each table through a query that coerces
UUID columns back to blobs regardless of how they were stored (text is
converted, blobs pass through untouched), so both formats decode. The
write path already adapts to the destination, so every source/destination
combination now produces a correct result, and importing a text-UUID
database canonicalizes it in the process.

Adds a regression test for text-stored UUIDs and an export/import matrix
covering every SQLite/PostgreSQL source-destination pair.
@AshDevFr AshDevFr merged commit cdcc9c9 into main Jul 5, 2026
22 checks passed
@AshDevFr AshDevFr deleted the fix/migrate-sqlite-text-uuids branch July 5, 2026 18:20
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.

1 participant