Skip to content

SQLite schema drift: a boolean field declaring defaultValue 'false' (a string) is reported as set_column_default drift on every read, and re-applying it changes nothing #37434

Backlog

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Filing gate: ① · Source: fleet (os-dev measurement on PR #37425 for #37345, report comment 7182686626) · finding class a · reach: named producer (SqlDriver.detectManagedDrift: the boot drift warning and os migrate plan, on any SQLite datasource).

Grading: area:data · Bug · measured at PR #37425 head f438ff8c through both driver-turso faces; not introduced by that PR (the local face has written '0' since before it) · evidence: measured.
Suggested-grade: p3 · a permanent false drift entry; no data is wrong, but the drift report never goes clean for such a field and a re-apply loops.

What

A boolean field declaring defaultValue: 'false' (a string) gets column DEFAULT '0' (knex's boolean formatter on the local face; the shared renderer on the remote face after PR #37425). packages/drivers/driver-sql/src/schema-drift.ts physicalLiteralMatches compares a string declaration as text, so it reports default_mismatch / set_column_default (expected DEFAULT 'false', actual DEFAULT '0') on every read, and applying the entry writes '0' again.

Acceptance (proposed, for triage)

  • The differ normalises a boolean declaration the way the writer renders it ('false' / false → 0, a truthy value → 1, for boolean and toggle columns), so a freshly synced column reads zero drift on both faces.
  • turso-remote-default-parity.test.ts's separate 'false' describe joins the per-kind zero-drift set; the docblock note pointing here goes.

Related: #37345 (PR #37425), #36245 (local DEFAULT drift).
Dedupe: searched 'physicalLiteralMatches', 'set_column_default boolean', 'default_mismatch boolean' — no open card.

Activity

  1. added
    finding
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

    Correction · area o5-D · 2026-11-26T05:00Z (contract record 7183095333 on PR #37425, nit N3)
    "Not introduced by that PR" holds for the local face only. On the remote Turso/libSQL face this false drift becomes reachable with PR #37425 (no DEFAULT was written there before), and there the entry is one the remote apply door cannot act on either (needs-table-rebuild, #37430). Reach is unchanged: a boolean field declaring the string 'false'; the outcome equals the local face's report.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:data · Bug · priority:p3 · pm:queue · size S; rationale: a boolean field that declares defaultValue: 'false' as a string shows a permanent set_column_default drift on any SQLite datasource, and re-applying it loops. No stored data is wrong, so p3, as suggested.

    It sits with the drift-differ family (#37430, #37345). finding stays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:datafindingpm:queuepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions