Skip to content

LocalIndexSpec

Defined in: packages/contracts/src/config.ts:543

One index the LOCAL store should carry on a synced table (see ClientProjectionSpec.localIndexes). A plain ascending btree over projected columns — deliberately the same expressiveness the local schema generator’s shared CREATE INDEX core has for the journal indexes, and no more.

columns: readonly string[]

Defined in: packages/contracts/src/config.ts:552

The indexed columns, in order. Each names a column of the entry’s table by DB column name or by Drizzle property key (the same either/or the primary-key specs accept), and must survive the client projection: naming an omitColumns column is a registry error, because the local table has no such column to index.


name: string

Defined in: packages/contracts/src/config.ts:545

The index’s name. Unique within the entry, and a plain identifier — it is emitted into DDL.


optional unique?: boolean

Defined in: packages/contracts/src/config.ts:558

Emit CREATE UNIQUE INDEX. Note what that means for a synced cache: uniqueness is the SERVER’s guarantee, and a local unique index turns a violation into a failed apply rather than a rejected write. Declare it only where the server constraint genuinely holds for the projected rows.