Type Alias: LixGenerated<T>

LixGenerated<T> = T & object

Marker type for database columns that are auto-generated.

This type brands values as "generated" to enable special handling in insert/update operations. Generated fields become optional in inserts since the database provides default values.

The type accepts T values directly for developer convenience while preserving the generated marker for type transformations.

Type declaration

__lixGenerated?

readonly optional __lixGenerated: true

Type Parameters

T

T

Example

type Account = {
  id: LixGenerated<string>;  // Auto-generated UUID
  name: string;              // User-provided
  created_at: LixGenerated<string>;  // Auto-generated timestamp
};

// In inserts, generated fields are optional
const newAccount: LixInsertable<Account> = {
  name: "John"  // id and created_at are optional
};