import { AnyQueryAst, DdlNode, LoweredStatement, LowererContext, MarkerReadResult, SqlExecuteRequest } from "@prisma-next/sql-relational-core/ast"; import { SqlEscapeError, escapeLiteral, quoteIdentifier } from "@prisma-next/target-sqlite/sql-utils"; import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types"; import { parseSqliteDefault, parseSqliteDefault as parseSqliteDefault$1 } from "@prisma-next/target-sqlite/default-normalizer"; import { normalizeSqliteNativeType, normalizeSqliteNativeType as normalizeSqliteNativeType$1 } from "@prisma-next/target-sqlite/native-type-normalizer"; import { SqlControlAdapterDescriptor } from "@prisma-next/family-sql/control"; import { SqliteDdlNode } from "@prisma-next/target-sqlite/ddl"; import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types"; import { SqlControlDriverInstance } from "@prisma-next/sql-contract/types"; import { CodecRegistry } from "@prisma-next/framework-components/codec"; import { SqlControlAdapter } from "@prisma-next/family-sql/control-adapter"; //#region src/core/codec-lookup.d.ts /** * Build a {@link CodecRegistry} populated with the SQLite-builtin codec definitions only. * * Used by `createSqliteAdapter()` and `new SqliteControlAdapter()` when called without a * stack-derived registry (e.g. from tests, or one-off scripts that don't compose a full stack). * * Extension codecs are intentionally NOT included: a bare adapter cannot see extensions. * Stack-composed paths supply the broader, extension-inclusive registry at construction time. */ declare function createSqliteBuiltinCodecLookup(): CodecRegistry; //#endregion //#region src/core/control-adapter.d.ts declare class SqliteControlAdapter implements SqlControlAdapter<'sqlite'> { readonly familyId: "sql"; readonly targetId: "sqlite"; private readonly codecRegistry; constructor(codecRegistry: CodecRegistry); readonly normalizeDefault: typeof parseSqliteDefault$1; readonly normalizeNativeType: typeof normalizeSqliteNativeType$1; bootstrapControlTableQueries(): readonly DdlNode[]; bootstrapSignMarkerQueries(): readonly DdlNode[]; /** * Lower a SQL query AST into a SQLite-flavored `{ sql, params }` payload. * * Delegates to the shared `renderLoweredSql` renderer so the control adapter * emits byte-identical SQL to `SqliteAdapterImpl.lower()` for the same AST * and contract. Used at migration plan/emit time (e.g. by `dataTransform`) * without instantiating the runtime adapter. */ lower(ast: AnyQueryAst | SqliteDdlNode, context: LowererContext): LoweredStatement; /** * Lower an AST all the way to a driver-ready statement. For DDL nodes, * literal column defaults are formatted as inline SQL with SQLite-specific * literal syntax (no cast suffix, boolean as 0/1, blob via X'hex'). For * query ASTs, params are kept as `?` placeholders; wire values go in * `params`. Does NOT call `this.lower()` — independent implementation. */ lowerToExecuteRequest(ast: AnyQueryAst | SqliteDdlNode, context?: LowererContext): Promise; /** * Reads the contract marker from `_prisma_marker`. Probes `sqlite_master` * first so a fresh database (no marker table) returns `null` instead of a * "no such table" error. */ readMarker(driver: SqlControlDriverInstance<'sqlite'>, space: string): Promise; readMarkerDiscriminated(driver: SqlControlDriverInstance<'sqlite'>, space: string): Promise; /** * Reads every row from `_prisma_marker` and returns them keyed by * `space`. Mirrors the existence probe in {@link readMarker}: a * fresh database without the marker table returns an empty map. */ readAllMarkers(driver: SqlControlDriverInstance<'sqlite'>): Promise>; private readAllMarkersResult; /** * Reads per-migration ledger rows from `_prisma_ledger` in apply order. * Probes `sqlite_master` first so a fresh database without the ledger * table returns `[]` instead of raising "no such table". */ readLedger(driver: SqlControlDriverInstance<'sqlite'>, space?: string): Promise; private readLedgerResult; /** * Stamps the initial marker row for `space` via the shared contract-free DML * builder, lowered through {@link lower} and executed on the driver. See the * `SqlControlAdapter.initMarker` contract. */ insertMarker(driver: SqlControlDriverInstance<'sqlite'>, space: string, destination: { readonly storageHash: string; readonly profileHash: string; readonly invariants?: readonly string[]; }): Promise; initMarker(driver: SqlControlDriverInstance<'sqlite'>, space: string, destination: { readonly storageHash: string; readonly profileHash: string; readonly invariants?: readonly string[]; }): Promise; /** * Compare-and-swap advance of the marker row for `space`. See the * `SqlControlAdapter.updateMarker` contract. */ updateMarker(driver: SqlControlDriverInstance<'sqlite'>, space: string, expectedFrom: string, destination: { readonly storageHash: string; readonly profileHash: string; readonly invariants?: readonly string[]; }): Promise; /** * Appends a ledger entry for `space`. See the * `SqlControlAdapter.writeLedgerEntry` contract. */ writeLedgerEntry(driver: SqlControlDriverInstance<'sqlite'>, space: string, entry: { readonly edgeId: string; readonly from: string; readonly to: string; readonly migrationName: string; readonly migrationHash: string; readonly operations: readonly unknown[]; }): Promise; private readMarkerResult; introspect(driver: SqlControlDriverInstance<'sqlite'>, _contract?: unknown): Promise; } //#endregion //#region src/exports/control.d.ts declare const sqliteAdapterDescriptor: SqlControlAdapterDescriptor<'sqlite'>; //#endregion export { SqlEscapeError, SqliteControlAdapter, createSqliteBuiltinCodecLookup, sqliteAdapterDescriptor as default, escapeLiteral, normalizeSqliteNativeType, parseSqliteDefault, quoteIdentifier }; //# sourceMappingURL=control.d.mts.map