switchVersion(
args: {lix:Lix;to:Pick<LixVersion,"id">; }):Promise<void>
Switches the current Version to the given Version.
The Version must already exist before calling this function.
await switchVersion({ lix, to: otherVersion });Switching to a newly created version.
await lix.db.transaction().execute(async (trx) => {
const newVersion = await createVersion({ lix: { db: trx }, commit: currentVersion });
await switchVersion({ lix: { db: trx }, to: newVersion });
});| Parameter | Type |
|---|---|
args | { lix: Lix; to: Pick<LixVersion, "id">; } |
args.lix | Lix |
args.to | Pick<LixVersion, "id"> |
Promise<void>