Function: createAccount()

createAccount(args: { id?: LixGenerated<string>; lix: Pick<Lix, "db" | "sqlite" | "hooks">; lixcol_version_id?: string; name: string; }): Promise<{ id: LixGenerated<string>; name: string; }>

Inserts a new account into the Lix database.

Accounts represent different identities working with the same Lix file. Switching the active account is handled separately via switchAccount.

Example

const account = await createAccount({ lix, name: "Jane" })

Parameters

ParameterType
args{ id?: LixGenerated<string>; lix: Pick<Lix, "db" | "sqlite" | "hooks">; lixcol_version_id?: string; name: string; }
args.id?LixGenerated<string>
args.lixPick<Lix, "db" | "sqlite" | "hooks">
args.lixcol_version_id?string
args.namestring

Returns

Promise<{ id: LixGenerated<string>; name: string; }>