NewStateByVersion<
T> =LixInsertable<EntityStateByVersionView<T>>
Type for creating new entities with version control.
This type includes lixcol_version_id for creating entities in specific versions. Like NewState, it makes LixGenerated columns optional.
// Use NewStateByVersion for version-specific creation
async function createFeatureFlag(versionId: string, flag: {
key: string;
value: boolean;
}) {
const newFlag: NewStateByVersion<KeyValue> = {
key: flag.key,
value: flag.value,
lixcol_version_id: versionId // Create in specific version
};
await lix.db
.insertInto("key_value_by_version")
.values(newFlag)
.execute();
}| Type Parameter |
|---|
T |