newLixFile(
args?: {keyValues?:NewStateByVersion<LixKeyValue>[]; }):Promise<NewLixBlob>
Creates a new Lix file as a NewLixBlob.
This function bootstraps an in-memory SQLite database with the necessary schema and metadata to represent a valid Lix project. The resulting blob is ready to be persisted to disk, IndexedDB, or other storage.
The returned blob has a ._lix property for immediate access to the
lix identifier and name without needing to open the file.
| Parameter | Type | Description |
|---|---|---|
args? | { keyValues?: NewStateByVersion<LixKeyValue>[]; } | - |
args.keyValues? | NewStateByVersion<LixKeyValue>[] | Pre-populates the key-value store of the new lix file. Use this to set initial values for lix_id, lix_name, or other custom keys. If lix_id or lix_name are not provided, they will be generated automatically. The lixcol_version_id defaults to the active version. Example keyValues: [ { key: "lix_name", value: "my-project", lixcol_version_id: "global" }, { key: "lix_id", value: "custom-id", lixcol_version_id: "global" }, { key: "my_custom_key", value: "my_custom_value", lixcol_version_id: "global" }, ] |
Promise<NewLixBlob>