LixGenerated<
T> =T& {__lixGenerated?:true; }
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 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
};
readonlyoptional__lixGenerated:true
| Type Parameter |
|---|
T |