{"version":3,"sources":["../../../src/backend/sqlite/local-store.ts"],"names":["loadDrizzleBackedModule"],"mappings":";;;;;;;AAwGA,eAAsB,sBAAA,CACpB,KAAA,EACA,OAAA,GAAmC,EAAC,EACwB;AAC5D,EAAA,MAAM,OAAO,MAAMA,yCAAA;AAAA,IACjB,gBAAA;AAAA,IACA,MAAM,OAAO,qCAAoB;AAAA,GACnC;AACA,EAAA,OAAO,IAAA,CAAK,0BAAA,CAA2B,KAAA,EAAO,OAAO,CAAA;AACvD","file":"local-store.cjs","sourcesContent":["/**\n * Batteries-included local SQLite Store for strict TypeScript consumers.\n *\n * This entrypoint owns the connection and intentionally exposes the portable\n * TypeGraph Store surface rather than the adapter-native Drizzle handle.\n */\nimport { type GraphDef } from \"../../core/define-graph\";\nimport { type SchemaManagerOptions } from \"../../schema/manager\";\nimport {\n  type HistoryStore,\n  type RecordedReadStore,\n  type Store,\n} from \"../../store/store\";\nimport {\n  type HistoryStoreOptions,\n  type LiveStoreOptions,\n  type RecordedReadStoreOptions,\n  type StoreOptions,\n  type UnboundLiveStoreOptions,\n} from \"../../store/types\";\nimport { loadDrizzleBackedModule } from \"../missing-peer-ledger\";\nimport { type BundledBackendCapabilityOverrides } from \"../types\";\nexport type { BundledBackendCapabilityOverrides } from \"../types\";\nimport { type FulltextStrategy } from \"../../query/dialect/fulltext-strategy\";\nimport { type LocalSqlitePragmaOptions } from \"./local-options\";\n\nexport type { GraphIdentityConfig } from \"../../core/define-graph\";\nexport type {\n  IdentityAssertion,\n  IdentityAssertionId,\n  IdentityAssertionResult,\n  IdentityFacade,\n  IdentityNode,\n  IdentityNodeRefInput,\n  IdentityPair,\n  IdentityReadFacade,\n  IdentityRelation,\n  IdentityWriteSummary,\n} from \"../../identity\";\nexport type {\n  ContributionDiagnostic,\n  ContributionDiagnosticState,\n  ContributionRepairEntry,\n  ContributionRepairResult,\n} from \"../types\";\nexport {\n  DEFAULT_LOCAL_SQLITE_PRAGMAS,\n  type LocalSqliteJournalMode,\n  type LocalSqlitePragmaOptions,\n  type LocalSqliteSynchronousMode,\n} from \"./local-options\";\n\nexport type LocalSqliteStoreOptions<\n  TStoreOptions extends StoreOptions = StoreOptions,\n> = Readonly<{\n  /** SQLite file path. Defaults to an in-memory database. */\n  path?: string;\n  /** Connection pragmas applied when the owned database is opened. */\n  pragmas?: LocalSqlitePragmaOptions | false;\n  /** Optional backend capability overrides, primarily for controlled hosts. */\n  capabilities?: BundledBackendCapabilityOverrides;\n  /**\n   * Override the fulltext strategy. Defaults to `fts5Strategy` (SQLite's\n   * built-in FTS5 virtual table). Pass `false` to disable fulltext support\n   * entirely — the backend then advertises no `capabilities.fulltext` and\n   * omits the fulltext CRUD/search methods, and the managed installation\n   * never creates the fulltext table. Forwarded to both the installation\n   * DDL and `createSqliteBackend`.\n   */\n  fulltext?: FulltextStrategy | false;\n  /** Store behavior, including hooks, history, and custom table names. */\n  store?: TStoreOptions;\n  /**\n   * Schema initialization and migration policy. `schema` is excluded here:\n   * the effective SqlSchema has exactly one source — `store.schema` — which\n   * this constructor also uses to provision the physical tables, so a\n   * second schema could name tables that were never created.\n   */\n  schemaManagement?: Omit<SchemaManagerOptions, \"schema\">;\n}>;\n\n/** Creates, provisions, and returns a full typed local SQLite Store. */\nexport function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options?: LocalSqliteStoreOptions<UnboundLiveStoreOptions>,\n): Promise<Store<G>>;\nexport function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalSqliteStoreOptions<HistoryStoreOptions> &\n    Readonly<{ store: HistoryStoreOptions }>,\n): Promise<HistoryStore<G>>;\nexport function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalSqliteStoreOptions<RecordedReadStoreOptions> &\n    Readonly<{ store: RecordedReadStoreOptions }>,\n): Promise<RecordedReadStore<G>>;\nexport function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalSqliteStoreOptions<LiveStoreOptions>,\n): Promise<Store<G> | RecordedReadStore<G>>;\nexport function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalSqliteStoreOptions,\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;\nexport async function createLocalSqliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalSqliteStoreOptions = {},\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>> {\n  const impl = await loadDrizzleBackedModule(\n    \"./sqlite/local\",\n    () => import(\"./local-store-impl\"),\n  );\n  return impl.createLocalSqliteStoreImpl(graph, options);\n}\n"]}