{"version":3,"sources":["../../../src/backend/postgres/pglite-store.ts"],"names":["loadDrizzleBackedModule"],"mappings":";;;;;;AA2FA,eAAsB,sBAAA,CACpB,KAAA,EACA,OAAA,GAAmC,EAAC,EACwB;AAC5D,EAAA,MAAM,OAAO,MAAMA,yCAAA;AAAA,IACjB,mBAAA;AAAA,IACA,MAAM,OAAO,sCAAqB;AAAA,GACpC;AACA,EAAA,OAAO,IAAA,CAAK,0BAAA,CAA2B,KAAA,EAAO,OAAO,CAAA;AACvD","file":"pglite-store.cjs","sourcesContent":["/**\n * Batteries-included local PostgreSQL Store backed by PGlite.\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 FulltextStrategy } from \"../../query/dialect/fulltext-strategy\";\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\";\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\";\n\nexport type LocalPgliteStoreOptions<\n  TStoreOptions extends StoreOptions = StoreOptions,\n> = Readonly<{\n  /** PGlite data directory. Defaults to an in-memory database. */\n  dataDir?: string;\n  /** Whether to load pgvector. Defaults to true. */\n  vector?: boolean;\n  /**\n   * Override the fulltext strategy. Defaults to `tsvectorStrategy`. Pass\n   * `false` to disable fulltext support entirely — the backend then\n   * advertises no `capabilities.fulltext` and omits the fulltext CRUD/search\n   * methods, and the installation DDL never creates the fulltext table.\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 PGlite Store. */\nexport function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options?: LocalPgliteStoreOptions<UnboundLiveStoreOptions>,\n): Promise<Store<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalPgliteStoreOptions<HistoryStoreOptions> &\n    Readonly<{ store: HistoryStoreOptions }>,\n): Promise<HistoryStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalPgliteStoreOptions<RecordedReadStoreOptions> &\n    Readonly<{ store: RecordedReadStoreOptions }>,\n): Promise<RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalPgliteStoreOptions<LiveStoreOptions>,\n): Promise<Store<G> | RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalPgliteStoreOptions,\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;\nexport async function createLocalPgliteStore<G extends GraphDef>(\n  graph: G,\n  options: LocalPgliteStoreOptions = {},\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>> {\n  const impl = await loadDrizzleBackedModule(\n    \"./postgres/pglite\",\n    () => import(\"./pglite-store-impl\"),\n  );\n  return impl.createLocalPgliteStoreImpl(graph, options);\n}\n"]}