Function: createChangeSet()

createChangeSet(args): Promise<object & object>

Creates a change set and optionally attaches elements, labels and parents.

Change sets are the building blocks of versions and checkpoints. This function inserts all provided relations in a single transaction and returns the newly created record.

Parameters

args

elements?

Omit<NewState<{ change_id: string; change_set_id: string; entity_id: string; file_id: string; schema_key: string; }>, "change_set_id">[]

id?

string

labels?

Pick<{ id: LixGenerated<string>; name: string; }, "id">[]

lix

Pick<Lix, "db">

lixcol_version_id?

string

Version ID where the change set should be stored. Defaults to active version

parents?

Pick<{ id: LixGenerated<string>; metadata?: null | Record<string, any>; }, "id">[]

Parent change sets that this change set will be a child of

Returns

Promise<object & object>

Example

const cs = await createChangeSet({ lix, elements: [{ change_id, entity_id }] })