import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'; import { S as SchemaProvisioning, d as FulltextStrategy, B as BundledBackendCapabilityOverrides, A as AdapterBackend } from '../../types-BynPp5kU.js'; export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-BynPp5kU.js'; import { A as AnySqliteDatabase } from '../../sqlite-execution-DHenxnsc.js'; import { a as SqliteTables } from '../../sqlite-CcCSeXGg.js'; import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.js'; export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.js'; import 'zod'; import 'drizzle-orm/sqlite-core'; /** * Options for creating a local SQLite backend. */ type LocalSqliteBackendOptions = Readonly<{ schemaProvisioning?: SchemaProvisioning; /** * Path to the SQLite database file. * Defaults to ":memory:" for an in-memory database. */ path?: string; /** * Connection pragmas applied at open. Defaults to * {@link DEFAULT_LOCAL_SQLITE_PRAGMAS} (WAL, `synchronous=NORMAL`, 5s busy * timeout, and SQLite's own tiny built-in page cache / disabled mmap * left untouched). Individual values merge over the defaults; pass * `false` to skip pragma configuration entirely and keep the driver * defaults (rollback journal, `synchronous=FULL`, and better-sqlite3's * own 5s busy timeout from its `timeout` constructor option). Set * `cacheSizeKib`/`mmapSizeBytes` explicitly once a database's working * set is known to exceed SQLite's 2MiB default cache — otherwise every * query pays a fresh disk read per page past that tiny working set. Set * `walAutocheckpointPages` explicitly for a bulk-insert-heavy workload — * SQLite's own default checkpoints every ~4MiB of WAL growth, which gets * more expensive as the database file grows over a large load. */ pragmas?: LocalSqlitePragmaOptions | false; /** * Custom table definitions. * Defaults to standard TypeGraph table names. */ tables?: SqliteTables; /** * Override the fulltext strategy. Defaults to `fts5Strategy` (SQLite's * built-in FTS5 virtual table). Pass `false` to disable fulltext support * entirely — the backend then advertises no `capabilities.fulltext` and * omits the fulltext CRUD/search methods, and the managed installation * never creates the fulltext table. Forwarded to both the installation * DDL and `createSqliteBackend`. */ fulltext?: FulltextStrategy | false; /** * Override specific backend capabilities — e.g. to simulate an engine-level * gap like missing SQL window functions in tests. Forwarded to * createSqliteBackend. */ capabilities?: BundledBackendCapabilityOverrides; }>; /** * Result of creating a local SQLite backend. */ type LocalSqliteBackendResult = Readonly<{ /** * The GraphBackend instance for use with createStore. */ backend: AdapterBackend; /** * The underlying Drizzle database instance. * Useful for direct SQL access or cleanup. */ db: BetterSQLite3Database; }>; /** * Creates a SQLite backend with minimal configuration. * * This is a convenience function for local development and testing. * It handles database creation, schema migration, and backend setup. * * For production deployments or custom configurations, use createSqliteBackend * directly with your own Drizzle database instance. * * @param options - Configuration options * @returns Backend and database instances * * @example In-memory database (default) * ```typescript * const { backend } = createLocalSqliteBackend(); * const store = createStore(graph, backend); * ``` * * @example File-based database * ```typescript * const { backend, db } = createLocalSqliteBackend({ path: "./data.db" }); * const store = createStore(graph, backend); * ``` */ declare function createLocalSqliteBackend(options?: LocalSqliteBackendOptions): LocalSqliteBackendResult; export { AnySqliteDatabase, BundledBackendCapabilityOverrides, type LocalSqliteBackendOptions, type LocalSqliteBackendResult, LocalSqlitePragmaOptions, createLocalSqliteBackend };