sqlite/libsql: Schema diff fails to converge due to parenthesized column DEFAULT values (0) vs 0
Author: sooxt98Created Aug 19, 2026Updated Aug 19, 2026
Environment
- Driver:
turso.tech/database/tursogo(libSQL engine) - ORM / Tooling: Ent (
entgo.io/ent) using Atlas schema engine
Issue Description
When performing schema migration/diffing against a libSQL/Turso database using SQLite dialect, column DEFAULT expressions stored by libSQL are returned with surrounding parentheses (e.g., (''), (0), (FALSE)).
Atlas expects or normalizes schema definitions without parentheses (e.g., '', 0, false).
Because of this difference:
- Atlas continuously detects a schema diff on every run.
- It attempts a table recreation (
CREATE new->INSERT INTO ... SELECT->DROP->RENAME). - The diff never converges, causing infinite destructive table recreations on every application startup.
Expected Behavior
Atlas should normalize SQLite/libSQL column DEFAULT expressions during schema inspection so that (0) and 0 (or ('') and '') are treated as equivalent.
Source: ariga/atlas