import { S as SchemaProvisioning, d as FulltextStrategy, V as VectorStrategy, B as BundledBackendCapabilityOverrides, A as AdapterBackend } from './types-BynPp5kU.cjs'; import { A as AnySqliteDatabase, a as SqliteExecutionProfileHints } from './sqlite-execution-DHenxnsc.cjs'; import { S as SerializedResourceDeclaration, a as SqlEngineProfile } from './profile-DppApFgt.cjs'; import { a as SqliteTables } from './sqlite-BkQM9ZeI.cjs'; /** * Options for creating a SQLite backend. */ type SqliteBackendOptions = Readonly<{ /** Opt in to transactional DDL in a caller-owned schema transaction. */ schemaProvisioning?: SchemaProvisioning; /** * Custom table definitions. Use createSqliteTables() to customize table names. * Defaults to standard TypeGraph table names. */ tables?: SqliteTables; /** * Optional execution profile hints used to avoid runtime driver reflection. * Set `transactionMode: "none"` for drivers without transactions (e.g. * Cloudflare D1). Durable Objects (`drizzle(ctx.storage)`) auto-detect * `transactionMode: "do-sqlite"` and do not need a hint. Hosted platform * identity is authoritative when it conflicts with a stale hint. */ executionProfile?: SqliteExecutionProfileHints; /** * Fulltext strategy override. Defaults to `fts5Strategy` (SQLite's * built-in FTS5 virtual table). Most users should leave this alone. * * Pass `false` to disable fulltext support entirely. The backend then * advertises no `capabilities.fulltext` and omits the fulltext CRUD/ * search methods, mirroring `vector` left unset. A fulltext predicate, a * `searchable()` field, `store.search.fulltext`, and hybrid search all * refuse with a typed error instead of running SQL against a table * this backend never creates. Required for a SQLite build without * FTS5 compiled in. */ fulltext?: FulltextStrategy | false; /** * Vector strategy override. When present, the backend owns per-`(kind, * field)` typed storage through this strategy (DDL, upsert, delete, * similarity search, ANN index lifecycle) and advertises * `strategy.capabilities` as `capabilities.vector`. `createLibsqlBackend` * passes `libsqlVectorStrategy` unconditionally; `createLocalSqliteBackend` * passes `sqliteVecStrategy` when the extension loads. When absent the * backend exposes no vector capability and embedding values pass through * writes without being indexed — matching existing behavior for SQLite * connections without a vector extension. */ vector?: VectorStrategy; /** * Override specific backend capabilities. Useful for custom SQLite builds * or tests that need to simulate an engine-level capability gap. Overrides * may lower, but cannot raise, a hosted platform's hard parameter ceiling. */ capabilities?: BundledBackendCapabilityOverrides; /** * Declare the connection this backend serializes every statement onto, when * TypeGraph's driver predicates cannot see it (`expo-sqlite`, `op-sqlite`, * `sqlite-proxy`, a bespoke adapter) — or declare that it serializes on * nothing, when detection is wrong for your topology. * * Defaults to `{ mode: "detect" }`. See * {@link SerializedResourceDeclaration} for what each mode means and for the * one refusal it cannot lift (`same-sqlite-backend`: one backend object * exporting into itself). */ serializedResource?: SerializedResourceDeclaration; }>; /** * Creates a TypeGraph backend for SQLite databases (better-sqlite3, libsql, * Cloudflare D1, bun:sqlite, sql.js). * * @param db - A Drizzle SQLite database instance * @param options - Backend configuration * @returns A GraphBackend implementation */ declare function createSqliteBackend(db: AnySqliteDatabase, options?: SqliteBackendOptions): AdapterBackend; /** * Builds the SQLite {@link SqlEngineProfile} `createSqlBackend` (from * `./engine`) assembles into a backend: the head data and dialect-owned * late members (`transactions`, `fence`, `rawSql`, `maintenance`, * `trustedImport`, `extensions`) only SQLite supplies, plus the runtime deps * (`contributionRuntime`, `identityRuntime`, `graphTemplateRuntime`, * `baseSchemaRuntime`, `indexMaterializationRuntime`, `kindRemovalRuntime`) * `createSqlBackend` uses to assemble the mirrored member groups from * `members/*.ts`. */ declare function buildSqliteEngineProfile(db: AnySqliteDatabase, options?: SqliteBackendOptions): SqlEngineProfile; export { type SqliteBackendOptions as S, buildSqliteEngineProfile as b, createSqliteBackend as c };