Skip to content

SQLite: a NULLS-ordered complex index scaffolds the PostgreSQL sentinel, and applies without its ordering where SQLite accepts double-quoted strings #134

Closed

Description

@CaffeinatedCoder

Problem

On SQLite, a complex index with a NULLS-ordered part (DbOrder.NullsFirst / DbOrder.NullsLast) is diffed by the core differ, which routes it through the IndexParts annotation and appends CustomMigrationsModelDiffer.RuntimeWiringSentinel (__requires_UseNpgsqlComplexIndexes__) to Columns. SQLite has no satellite and no generator that reads the annotation, and its CREATE INDEX has no NULLS clause.

b.HasComplexIndex(x => DbOrder.NullsFirst(x.Email.V), isUnique: true, indexName: "ux_nulls");

Generated on SQLite with UseComplexIndexes():

CREATE UNIQUE INDEX "ux_nulls" ON "M" ("Email_V", "__requires_UseNpgsqlComplexIndexes__");

Applied for real (in-memory, Microsoft.Data.Sqlite, SQLite 3.53.3):

  • Double-quoted string literals off (the e_sqlite3 bundle, built with SQLITE_DQS=0): no such column: "__requires_UseNpgsqlComplexIndexes__". Loud, but the message names a PostgreSQL wiring a SQLite consumer cannot add.
  • Double-quoted string literals on (SQLITE_DBCONFIG_DQS_DDL, on in a default SQLite build, e.g. a system libsqlite3 or another SQLitePCLRaw bundle): applied. The index is created with the sentinel as a constant string column and no NULLS ordering. Uniqueness is unaffected (the constant is the same on every row); the declared ordering is lost without a word.

Found while measuring #95, where the same misfeature ruled out a column sentinel for the SQLite rebuild re-create (#95 puts its marker in the filter instead: an unknown function fails with DQS on or off).

Fix

Refuse a NULLS-ordered part at migrations add on providers the core serves without a satellite, as the SQL Server satellite already does, naming the provider. Same for any other part that sets RequiresPartsAnnotation there.

Activity

  1. added this to the 5.5.0 milestone on Oct 20, 2026
  2. added
    bug
    silent
    severity/low
    package/core
    area/indexes
    on Oct 20, 2026
  3. added a commit that references this issue on Oct 20, 2026
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/indexesbugpackage/coreseverity/lowsilent

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions