API reference › @evolu/common › local‑first/Schema › SystemColumns
Defined in: packages/common/src/local-first/Schema.ts:479
System columns that are implicitly defined by Evolu.
createdAt: The time of the row's earliest change.updatedAt: The time of the row's latest change, or null while the row has only one change.isDeleted: Soft delete flag created by Evolu and used by the developer to mark rows as deleted. Like any change, a soft delete adds to the row's history, so it frees no storage, locally or on relays.ownerId: Represents ownership and logically partitions the database.
Every insert, update, and upsert is a change, so an upsert of an existing row
sets updatedAt. A change that arrives late can move createdAt earlier,
never later. For "last changed", use updatedAt ?? createdAt.
Evolu takes both times from the Timestamp of each change, which orders
the changes of a synchronized table, so a device computes the same values
whatever order it receives the changes in. A
local-only table uses the time of each mutation
instead, and a change made at the time the row was created, such as one in
the same batch as its insert, does not set updatedAt. Neither column can be
set manually.
Extends
InferType<typeofSystemColumns>
Properties
createdAt
createdAt: string & Brand<"DateIso">;
Inherited from
InferType.createdAt
isDeleted
isDeleted: 0 | 1 | null;
Inherited from
InferType.isDeleted
ownerId
ownerId: string & Brand<"Id"> & Brand<"OwnerId">;
Inherited from
InferType.ownerId
updatedAt
updatedAt:
| string & Brand<"DateIso">
| null;
Inherited from
InferType.updatedAt