| 153 | * Auth can open its own libSQL connection to the same `file:` URL). |
| 154 | */ |
| 155 | export const createSelfHostDb = (options: SelfHostDbLayerOptions): Promise<SelfHostDbHandle> => |
| 156 | createSqliteExecutorDb({ |
| 157 | tables: collectTables(), |
| 158 | namespace: options.namespace ?? SELF_HOST_NAMESPACE, |
| 159 | version: options.version ?? SELF_HOST_SCHEMA_VERSION, |
| 160 | path: options.path, |
| 161 | }); |
| 162 | |
| 163 | // Shared DbProvider seam (P2a). The self-host handle keeps its libSQL driver, |
| 164 | // WAL/busy_timeout PRAGMAs, and the idempotent |