dbgate-sqlite-dumper 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,8 @@
1
- import { a as SqliteConnectionInput, A as AcquiredSqliteConnection, S as SqliteConnection, b as SqliteExecResult, c as SqliteRow, d as SqliteErrorInfo } from './types-CTyJTzB6.cjs';
2
- export { e as SqliteColumnValue, f as SqliteConnectionSource, g as SqliteParameterValue, h as SqliteQuery, i as SqliteQueryResult, j as SqliteStreamOptions, k as isSqliteConnectionSource } from './types-CTyJTzB6.cjs';
1
+ import { b as SqliteConnectionInput, A as AcquiredSqliteConnection, S as SqliteConnection, c as SqliteExecResult, d as SqliteRow, e as SqliteErrorInfo } from './types-DziV5ysl.cjs';
2
+ export { f as SqliteColumnValue, a as SqliteConnectionFeatures, g as SqliteConnectionSource, h as SqliteParameterValue, i as SqliteQuery, j as SqliteQueryResult, k as SqliteStreamOptions, l as isSqliteConnectionSource } from './types-DziV5ysl.cjs';
3
3
  import { Writable, Readable } from 'node:stream';
4
+ import { S as SqliteDumperError } from './errors-CplNzuYs.cjs';
5
+ export { O as OperationCancelledError, i as isAbortError, t as throwIfAborted } from './errors-CplNzuYs.cjs';
4
6
 
5
7
  /**
6
8
  * Normalizes a {@link SqliteConnectionInput} into an acquired connection with
@@ -22,6 +24,23 @@ declare function executeStatement(connection: SqliteConnection, sql: string, sig
22
24
  declare function toNumber(value: unknown, fallback?: number): number;
23
25
  /** Coerces a text-valued catalog cell to a string, or `null` for SQL `NULL`. */
24
26
  declare function toText(value: unknown): string | null;
27
+ /**
28
+ * Bytes as a `Buffer`, from any shape a driver returns them in: `Buffer`,
29
+ * `Uint8Array`, `ArrayBuffer` (libSQL), or an array of byte values (the
30
+ * JSON transport of Cloudflare D1).
31
+ */
32
+ declare function toBuffer(value: Uint8Array | ArrayBuffer | readonly number[]): Buffer;
33
+ /** {@link SqliteConnectionFeatures} with every default filled in. */
34
+ interface ResolvedConnectionFeatures {
35
+ readonly transactions: boolean;
36
+ readonly pragmaFunctions: boolean;
37
+ readonly extendedPragmas: boolean;
38
+ readonly schemaQualifiedNames: boolean;
39
+ readonly binaryTransport: 'native' | 'hex';
40
+ readonly pagedReadSize: number | undefined;
41
+ readonly reservedNamePrefixes: readonly string[];
42
+ }
43
+ declare function connectionFeatures(connection: SqliteConnection): ResolvedConnectionFeatures;
25
44
 
26
45
  /**
27
46
  * How a dump obtains a consistent view of the database.
@@ -48,6 +67,12 @@ interface SqliteDumpSession {
48
67
  * uncommitted changes. Reported so a caller can tell.
49
68
  */
50
69
  readonly joinedExistingTransaction: boolean;
70
+ /**
71
+ * `true` when a snapshot was asked for but the engine has no transactions
72
+ * (see `SqliteConnectionFeatures.transactions`), so the session reads
73
+ * without one and {@link consistency} is `'none'`.
74
+ */
75
+ readonly snapshotUnavailable: boolean;
51
76
  /**
52
77
  * Ends the read transaction. Idempotent. Never throws for a handle that is
53
78
  * already closed — cleanup must not mask the error that caused it.
@@ -721,6 +746,9 @@ interface SqliteIntrospectionResult {
721
746
  * to the plain `PRAGMA` statements otherwise.
722
747
  *
723
748
  * Runs entirely on the one handle it is given, in sequence, and never writes.
749
+ * A handle that declares {@link SqliteConnection.features} restrictions is
750
+ * read with the equivalent queries it does allow; one that has
751
+ * {@link SqliteConnection.queryBatch} gets the per-table catalog in batches.
724
752
  */
725
753
  declare function introspectSqlite(connection: SqliteConnection, options?: IntrospectSqliteOptions, signal?: AbortSignal): Promise<SqliteIntrospectionResult>;
726
754
 
@@ -1032,6 +1060,13 @@ interface TableDataExportRequest {
1032
1060
  * `ArchiveEntry.systemRowFilter`.
1033
1061
  */
1034
1062
  readonly systemRowFilter?: readonly string[];
1063
+ /**
1064
+ * The table's primary-key index (`origin` `pk`), for a `WITHOUT ROWID`
1065
+ * table read in pages: it gives the key order — direction and collation
1066
+ * of each column — that the pages follow. See
1067
+ * `SqliteConnectionFeatures.pagedReadSize`.
1068
+ */
1069
+ readonly primaryKeyIndex?: SqliteIndex;
1035
1070
  readonly options?: TableDataExportOptions;
1036
1071
  readonly signal?: AbortSignal;
1037
1072
  readonly onProgress?: DumpProgressCallback;
@@ -1071,6 +1106,21 @@ declare class SqlChunkBuilder {
1071
1106
  build(): string | Buffer;
1072
1107
  }
1073
1108
 
1109
+ /**
1110
+ * How the bytes of text and blob values travel from SQLite to this package.
1111
+ *
1112
+ * Natively they arrive as bytes. Over a transport that cannot carry bytes
1113
+ * exactly — JSON, for Cloudflare D1 — SQLite is asked for their `hex()`
1114
+ * instead, which any transport carries as plain ASCII text.
1115
+ */
1116
+ interface SqliteValueTransport {
1117
+ /** Text values (in a UTF-8 database) are read as `hex()` of their bytes. */
1118
+ readonly hexText: boolean;
1119
+ /** Blob values are read as `hex()`. */
1120
+ readonly hexBlob: boolean;
1121
+ }
1122
+ declare const NATIVE_VALUE_TRANSPORT: SqliteValueTransport;
1123
+ declare function valueTransport(utf8Database: boolean, binaryTransport: 'native' | 'hex'): SqliteValueTransport;
1074
1124
  /**
1075
1125
  * The select-list for one column: its storage class, and a value shaped so
1076
1126
  * that only exact representations cross the driver boundary.
@@ -1084,8 +1134,11 @@ declare class SqlChunkBuilder {
1084
1134
  * read as text instead and the driver's (lossless, for valid UTF-16)
1085
1135
  * conversion is used;
1086
1136
  * - `BLOB` → the bytes; `NULL` → `NULL`.
1137
+ *
1138
+ * With a hex {@link SqliteValueTransport}, text and blob bytes are read as
1139
+ * `hex()` text instead.
1087
1140
  */
1088
- declare function columnValueSelect(column: string, index: number, utf8Database: boolean): string;
1141
+ declare function columnValueSelect(column: string, index: number, utf8Database: boolean, transport?: SqliteValueTransport): string;
1089
1142
  /**
1090
1143
  * Renders column `index` of a row produced by {@link columnValueSelect} as
1091
1144
  * the SQL literal the native `.dump` writes for it.
@@ -1095,7 +1148,7 @@ declare function columnValueSelect(column: string, index: number, utf8Database:
1095
1148
  * stored value exactly (see `DumpWriter` for why that cannot go through a
1096
1149
  * string).
1097
1150
  */
1098
- declare function renderColumnLiteral(row: SqliteRow, index: number, textStyle: TextLiteralStyle): string | Buffer;
1151
+ declare function renderColumnLiteral(row: SqliteRow, index: number, textStyle: TextLiteralStyle, transport?: SqliteValueTransport): string | Buffer;
1099
1152
 
1100
1153
  /**
1101
1154
  * The columns the native `.dump` inserts: those `PRAGMA table_info` lists,
@@ -1246,25 +1299,6 @@ interface StatementSourceLocation {
1246
1299
  */
1247
1300
  type SqlDumpSource = string | Buffer | Uint8Array | Readable | AsyncIterable<string | Buffer | Uint8Array>;
1248
1301
 
1249
- /** Base class for every error this package throws intentionally. */
1250
- declare class SqliteDumperError extends Error {
1251
- readonly code: string;
1252
- constructor(code: string, message: string, options?: {
1253
- cause?: unknown;
1254
- });
1255
- }
1256
- /** Thrown when an operation stops because its `AbortSignal` was triggered. */
1257
- declare class OperationCancelledError extends SqliteDumperError {
1258
- constructor(message?: string);
1259
- }
1260
- declare function throwIfAborted(signal: AbortSignal | undefined): void;
1261
- /**
1262
- * True for both cancellation shapes this package can observe: its own
1263
- * {@link OperationCancelledError} and the `DOMException` an `AbortSignal`
1264
- * (or a Node stream aborted through one) raises.
1265
- */
1266
- declare function isAbortError(error: unknown): boolean;
1267
-
1268
1302
  /** Common base for every error {@link restoreSqlDump} (or its parser) throws intentionally. */
1269
1303
  declare class RestoreError extends SqliteDumperError {
1270
1304
  }
@@ -1890,4 +1924,4 @@ interface DumpResult {
1890
1924
  */
1891
1925
  declare function dumpSqlite(connectionInput: SqliteConnectionInput, options: DumpSqliteOptions, output: Writable, onProgress?: DumpProgressCallback, signal?: AbortSignal): Promise<DumpResult>;
1892
1926
 
1893
- export { AcquiredSqliteConnection, type ArchiveCycle, type ArchiveDependency, type ArchiveDependencyStrength, type ArchiveEntry, type ArchiveIdentityInput, type ArchiveObjectType, BufferDumpWriter, COMPLETE_TRANSITIONS, CompleteToken, DEFENSIVE_WARNING_COMMENT, type DotCommandPolicy, type DroppableKind, type DumpArchiveInspection, type DumpMode, type DumpObjectKinds, type DumpProgressCallback, type DumpProgressEvent, type DumpProgressPhase, type DumpProgressSection, type DumpResult, type DumpSection, type DumpSelection, type DumpSqliteOptions, type DumpWriter, type InspectDumpArchiveOptions, type IntrospectSqliteOptions, InvalidTextEncodingError, MalformedSqlDumpError, type NormalizedDumpSelection, OperationCancelledError, type ParsedStatement, type PlainSqlRenderOptions, type PlainSqlRenderRequest, type PlainSqlRenderResult, type PreflightRestoreReport, type PreflightRestoreRequest, type ResolvedPlainSqlRenderOptions, RestoreError, RestoreExecutionError, type RestoreOptions, type RestoreProgressCallback, type RestoreProgressEvent, type RestoreProgressPhase, RestoreSessionState, type RestoreStatementError, type RestoreWarning, SEQUENCE_TABLE_NAME, SESSION_GUARD_FOOTER, SESSION_GUARD_HEADER, SQLITE_KEYWORD_COUNT, type SkippedDotCommand, SqlChunkBuilder, type SqlDumpRestoreRequest, type SqlDumpRestoreResult, type SqlDumpSource, SqlParseError, SqlStatementParser, type SqlStatementParserOptions, type SqliteCapabilities, type SqliteColumn, type SqliteColumnHidden, SqliteConnection, SqliteConnectionInput, type SqliteConsistencyMode, type SqliteDatabase, type SqliteDiagnostic, type SqliteDiagnosticSeverity, type SqliteDumpSession, type SqliteDumpSessionOptions, SqliteDumperError, SqliteErrorInfo, SqliteExecResult, type SqliteForeignKey, type SqliteForeignKeyColumn, type SqliteIndex, type SqliteIndexColumn, type SqliteIntrospectionResult, type SqliteObjectKind, type SqliteObjectReference, SqliteRow, type SqliteSequence, type SqliteTable, type SqliteTableKind, type SqliteTrigger, type SqliteVersion, type SqliteView, type StatementInfo, type StatementSourceLocation, StatementTooLargeError, StreamDumpWriter, type TableDataExportOptions, type TableDataExportRequest, type TableDataExportResult, type TargetCapabilities, type TargetCompatibilityOptions, type TextLiteralStyle, UNSUPPORTED_FEATURES, type UnsatisfiedDependency, UnsupportedClientCommandError, WRITABLE_SCHEMA_OFF, WRITABLE_SCHEMA_ON, acquireSqliteConnection, assignDumpSection, beginSqliteDumpSession, checkTargetCompatibility, classifyWord, columnValueSelect, completeTransition, createArchiveIdentity, createCanonicalIdentity, createDumpId, declaresAutoincrement, decodeStatementBytes, describeStatement, detectSqliteCapabilities, detectSqliteVersion, detectSqliteCapabilities as detectTargetCapabilities, dumpSectionPriority, dumpSqlite, executeStatement, exportTableDataAsInserts, foldSqliteName, insertableColumns, inspectDumpArchive, introspectSqlite, isAbortError, isCompleteStatement, isIdentifierCharCode, isIndexSelected, isSchemaTableName, isSqliteDump, isSqliteKeyword, isStatisticsTableName, isTableDataExcluded, isTableSelected, isTriggerSelected, isTruthyPragmaValue, isViewSelected, maskSqlLiterals, needsIdentifierQuoting, normalizeDumpSelection, parseSqlStatements, parseSqliteVersion, parseTableOptions, parseVirtualTableModule, preflightRestore, preservableRowidName, quoteIdentifier, quoteIdentifierIfNeeded, quoteQualifiedIdentifier, quoteStringLiteral, redactSecrets, renderBlobLiteral, renderColumnLiteral, renderDatabaseSettings, renderDrop, renderEscapedStringLiteral, renderPlainSql, renderQuotedStringLiteral, renderSchemaLine, renderSchemaObject, renderSystemTablePrelude, renderTextLiteral, renderVirtualTable, resolvePlainSqlRenderOptions, restoreSqlDump, safeSqlPreview, streamSqlStatements, streamWithParser, tableGroupPriority, throwIfAborted, toAsciiLowerCase, toAsciiUpperCase, toByteStringChunks, toNumber, toText, unsupportedFeatureDiagnostics };
1927
+ export { AcquiredSqliteConnection, type ArchiveCycle, type ArchiveDependency, type ArchiveDependencyStrength, type ArchiveEntry, type ArchiveIdentityInput, type ArchiveObjectType, BufferDumpWriter, COMPLETE_TRANSITIONS, CompleteToken, DEFENSIVE_WARNING_COMMENT, type DotCommandPolicy, type DroppableKind, type DumpArchiveInspection, type DumpMode, type DumpObjectKinds, type DumpProgressCallback, type DumpProgressEvent, type DumpProgressPhase, type DumpProgressSection, type DumpResult, type DumpSection, type DumpSelection, type DumpSqliteOptions, type DumpWriter, type InspectDumpArchiveOptions, type IntrospectSqliteOptions, InvalidTextEncodingError, MalformedSqlDumpError, NATIVE_VALUE_TRANSPORT, type NormalizedDumpSelection, type ParsedStatement, type PlainSqlRenderOptions, type PlainSqlRenderRequest, type PlainSqlRenderResult, type PreflightRestoreReport, type PreflightRestoreRequest, type ResolvedConnectionFeatures, type ResolvedPlainSqlRenderOptions, RestoreError, RestoreExecutionError, type RestoreOptions, type RestoreProgressCallback, type RestoreProgressEvent, type RestoreProgressPhase, RestoreSessionState, type RestoreStatementError, type RestoreWarning, SEQUENCE_TABLE_NAME, SESSION_GUARD_FOOTER, SESSION_GUARD_HEADER, SQLITE_KEYWORD_COUNT, type SkippedDotCommand, SqlChunkBuilder, type SqlDumpRestoreRequest, type SqlDumpRestoreResult, type SqlDumpSource, SqlParseError, SqlStatementParser, type SqlStatementParserOptions, type SqliteCapabilities, type SqliteColumn, type SqliteColumnHidden, SqliteConnection, SqliteConnectionInput, type SqliteConsistencyMode, type SqliteDatabase, type SqliteDiagnostic, type SqliteDiagnosticSeverity, type SqliteDumpSession, type SqliteDumpSessionOptions, SqliteDumperError, SqliteErrorInfo, SqliteExecResult, type SqliteForeignKey, type SqliteForeignKeyColumn, type SqliteIndex, type SqliteIndexColumn, type SqliteIntrospectionResult, type SqliteObjectKind, type SqliteObjectReference, SqliteRow, type SqliteSequence, type SqliteTable, type SqliteTableKind, type SqliteTrigger, type SqliteValueTransport, type SqliteVersion, type SqliteView, type StatementInfo, type StatementSourceLocation, StatementTooLargeError, StreamDumpWriter, type TableDataExportOptions, type TableDataExportRequest, type TableDataExportResult, type TargetCapabilities, type TargetCompatibilityOptions, type TextLiteralStyle, UNSUPPORTED_FEATURES, type UnsatisfiedDependency, UnsupportedClientCommandError, WRITABLE_SCHEMA_OFF, WRITABLE_SCHEMA_ON, acquireSqliteConnection, assignDumpSection, beginSqliteDumpSession, checkTargetCompatibility, classifyWord, columnValueSelect, completeTransition, connectionFeatures, createArchiveIdentity, createCanonicalIdentity, createDumpId, declaresAutoincrement, decodeStatementBytes, describeStatement, detectSqliteCapabilities, detectSqliteVersion, detectSqliteCapabilities as detectTargetCapabilities, dumpSectionPriority, dumpSqlite, executeStatement, exportTableDataAsInserts, foldSqliteName, insertableColumns, inspectDumpArchive, introspectSqlite, isCompleteStatement, isIdentifierCharCode, isIndexSelected, isSchemaTableName, isSqliteDump, isSqliteKeyword, isStatisticsTableName, isTableDataExcluded, isTableSelected, isTriggerSelected, isTruthyPragmaValue, isViewSelected, maskSqlLiterals, needsIdentifierQuoting, normalizeDumpSelection, parseSqlStatements, parseSqliteVersion, parseTableOptions, parseVirtualTableModule, preflightRestore, preservableRowidName, quoteIdentifier, quoteIdentifierIfNeeded, quoteQualifiedIdentifier, quoteStringLiteral, redactSecrets, renderBlobLiteral, renderColumnLiteral, renderDatabaseSettings, renderDrop, renderEscapedStringLiteral, renderPlainSql, renderQuotedStringLiteral, renderSchemaLine, renderSchemaObject, renderSystemTablePrelude, renderTextLiteral, renderVirtualTable, resolvePlainSqlRenderOptions, restoreSqlDump, safeSqlPreview, streamSqlStatements, streamWithParser, tableGroupPriority, toAsciiLowerCase, toAsciiUpperCase, toBuffer, toByteStringChunks, toNumber, toText, unsupportedFeatureDiagnostics, valueTransport };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { a as SqliteConnectionInput, A as AcquiredSqliteConnection, S as SqliteConnection, b as SqliteExecResult, c as SqliteRow, d as SqliteErrorInfo } from './types-CTyJTzB6.js';
2
- export { e as SqliteColumnValue, f as SqliteConnectionSource, g as SqliteParameterValue, h as SqliteQuery, i as SqliteQueryResult, j as SqliteStreamOptions, k as isSqliteConnectionSource } from './types-CTyJTzB6.js';
1
+ import { b as SqliteConnectionInput, A as AcquiredSqliteConnection, S as SqliteConnection, c as SqliteExecResult, d as SqliteRow, e as SqliteErrorInfo } from './types-DziV5ysl.js';
2
+ export { f as SqliteColumnValue, a as SqliteConnectionFeatures, g as SqliteConnectionSource, h as SqliteParameterValue, i as SqliteQuery, j as SqliteQueryResult, k as SqliteStreamOptions, l as isSqliteConnectionSource } from './types-DziV5ysl.js';
3
3
  import { Writable, Readable } from 'node:stream';
4
+ import { S as SqliteDumperError } from './errors-CplNzuYs.js';
5
+ export { O as OperationCancelledError, i as isAbortError, t as throwIfAborted } from './errors-CplNzuYs.js';
4
6
 
5
7
  /**
6
8
  * Normalizes a {@link SqliteConnectionInput} into an acquired connection with
@@ -22,6 +24,23 @@ declare function executeStatement(connection: SqliteConnection, sql: string, sig
22
24
  declare function toNumber(value: unknown, fallback?: number): number;
23
25
  /** Coerces a text-valued catalog cell to a string, or `null` for SQL `NULL`. */
24
26
  declare function toText(value: unknown): string | null;
27
+ /**
28
+ * Bytes as a `Buffer`, from any shape a driver returns them in: `Buffer`,
29
+ * `Uint8Array`, `ArrayBuffer` (libSQL), or an array of byte values (the
30
+ * JSON transport of Cloudflare D1).
31
+ */
32
+ declare function toBuffer(value: Uint8Array | ArrayBuffer | readonly number[]): Buffer;
33
+ /** {@link SqliteConnectionFeatures} with every default filled in. */
34
+ interface ResolvedConnectionFeatures {
35
+ readonly transactions: boolean;
36
+ readonly pragmaFunctions: boolean;
37
+ readonly extendedPragmas: boolean;
38
+ readonly schemaQualifiedNames: boolean;
39
+ readonly binaryTransport: 'native' | 'hex';
40
+ readonly pagedReadSize: number | undefined;
41
+ readonly reservedNamePrefixes: readonly string[];
42
+ }
43
+ declare function connectionFeatures(connection: SqliteConnection): ResolvedConnectionFeatures;
25
44
 
26
45
  /**
27
46
  * How a dump obtains a consistent view of the database.
@@ -48,6 +67,12 @@ interface SqliteDumpSession {
48
67
  * uncommitted changes. Reported so a caller can tell.
49
68
  */
50
69
  readonly joinedExistingTransaction: boolean;
70
+ /**
71
+ * `true` when a snapshot was asked for but the engine has no transactions
72
+ * (see `SqliteConnectionFeatures.transactions`), so the session reads
73
+ * without one and {@link consistency} is `'none'`.
74
+ */
75
+ readonly snapshotUnavailable: boolean;
51
76
  /**
52
77
  * Ends the read transaction. Idempotent. Never throws for a handle that is
53
78
  * already closed — cleanup must not mask the error that caused it.
@@ -721,6 +746,9 @@ interface SqliteIntrospectionResult {
721
746
  * to the plain `PRAGMA` statements otherwise.
722
747
  *
723
748
  * Runs entirely on the one handle it is given, in sequence, and never writes.
749
+ * A handle that declares {@link SqliteConnection.features} restrictions is
750
+ * read with the equivalent queries it does allow; one that has
751
+ * {@link SqliteConnection.queryBatch} gets the per-table catalog in batches.
724
752
  */
725
753
  declare function introspectSqlite(connection: SqliteConnection, options?: IntrospectSqliteOptions, signal?: AbortSignal): Promise<SqliteIntrospectionResult>;
726
754
 
@@ -1032,6 +1060,13 @@ interface TableDataExportRequest {
1032
1060
  * `ArchiveEntry.systemRowFilter`.
1033
1061
  */
1034
1062
  readonly systemRowFilter?: readonly string[];
1063
+ /**
1064
+ * The table's primary-key index (`origin` `pk`), for a `WITHOUT ROWID`
1065
+ * table read in pages: it gives the key order — direction and collation
1066
+ * of each column — that the pages follow. See
1067
+ * `SqliteConnectionFeatures.pagedReadSize`.
1068
+ */
1069
+ readonly primaryKeyIndex?: SqliteIndex;
1035
1070
  readonly options?: TableDataExportOptions;
1036
1071
  readonly signal?: AbortSignal;
1037
1072
  readonly onProgress?: DumpProgressCallback;
@@ -1071,6 +1106,21 @@ declare class SqlChunkBuilder {
1071
1106
  build(): string | Buffer;
1072
1107
  }
1073
1108
 
1109
+ /**
1110
+ * How the bytes of text and blob values travel from SQLite to this package.
1111
+ *
1112
+ * Natively they arrive as bytes. Over a transport that cannot carry bytes
1113
+ * exactly — JSON, for Cloudflare D1 — SQLite is asked for their `hex()`
1114
+ * instead, which any transport carries as plain ASCII text.
1115
+ */
1116
+ interface SqliteValueTransport {
1117
+ /** Text values (in a UTF-8 database) are read as `hex()` of their bytes. */
1118
+ readonly hexText: boolean;
1119
+ /** Blob values are read as `hex()`. */
1120
+ readonly hexBlob: boolean;
1121
+ }
1122
+ declare const NATIVE_VALUE_TRANSPORT: SqliteValueTransport;
1123
+ declare function valueTransport(utf8Database: boolean, binaryTransport: 'native' | 'hex'): SqliteValueTransport;
1074
1124
  /**
1075
1125
  * The select-list for one column: its storage class, and a value shaped so
1076
1126
  * that only exact representations cross the driver boundary.
@@ -1084,8 +1134,11 @@ declare class SqlChunkBuilder {
1084
1134
  * read as text instead and the driver's (lossless, for valid UTF-16)
1085
1135
  * conversion is used;
1086
1136
  * - `BLOB` → the bytes; `NULL` → `NULL`.
1137
+ *
1138
+ * With a hex {@link SqliteValueTransport}, text and blob bytes are read as
1139
+ * `hex()` text instead.
1087
1140
  */
1088
- declare function columnValueSelect(column: string, index: number, utf8Database: boolean): string;
1141
+ declare function columnValueSelect(column: string, index: number, utf8Database: boolean, transport?: SqliteValueTransport): string;
1089
1142
  /**
1090
1143
  * Renders column `index` of a row produced by {@link columnValueSelect} as
1091
1144
  * the SQL literal the native `.dump` writes for it.
@@ -1095,7 +1148,7 @@ declare function columnValueSelect(column: string, index: number, utf8Database:
1095
1148
  * stored value exactly (see `DumpWriter` for why that cannot go through a
1096
1149
  * string).
1097
1150
  */
1098
- declare function renderColumnLiteral(row: SqliteRow, index: number, textStyle: TextLiteralStyle): string | Buffer;
1151
+ declare function renderColumnLiteral(row: SqliteRow, index: number, textStyle: TextLiteralStyle, transport?: SqliteValueTransport): string | Buffer;
1099
1152
 
1100
1153
  /**
1101
1154
  * The columns the native `.dump` inserts: those `PRAGMA table_info` lists,
@@ -1246,25 +1299,6 @@ interface StatementSourceLocation {
1246
1299
  */
1247
1300
  type SqlDumpSource = string | Buffer | Uint8Array | Readable | AsyncIterable<string | Buffer | Uint8Array>;
1248
1301
 
1249
- /** Base class for every error this package throws intentionally. */
1250
- declare class SqliteDumperError extends Error {
1251
- readonly code: string;
1252
- constructor(code: string, message: string, options?: {
1253
- cause?: unknown;
1254
- });
1255
- }
1256
- /** Thrown when an operation stops because its `AbortSignal` was triggered. */
1257
- declare class OperationCancelledError extends SqliteDumperError {
1258
- constructor(message?: string);
1259
- }
1260
- declare function throwIfAborted(signal: AbortSignal | undefined): void;
1261
- /**
1262
- * True for both cancellation shapes this package can observe: its own
1263
- * {@link OperationCancelledError} and the `DOMException` an `AbortSignal`
1264
- * (or a Node stream aborted through one) raises.
1265
- */
1266
- declare function isAbortError(error: unknown): boolean;
1267
-
1268
1302
  /** Common base for every error {@link restoreSqlDump} (or its parser) throws intentionally. */
1269
1303
  declare class RestoreError extends SqliteDumperError {
1270
1304
  }
@@ -1890,4 +1924,4 @@ interface DumpResult {
1890
1924
  */
1891
1925
  declare function dumpSqlite(connectionInput: SqliteConnectionInput, options: DumpSqliteOptions, output: Writable, onProgress?: DumpProgressCallback, signal?: AbortSignal): Promise<DumpResult>;
1892
1926
 
1893
- export { AcquiredSqliteConnection, type ArchiveCycle, type ArchiveDependency, type ArchiveDependencyStrength, type ArchiveEntry, type ArchiveIdentityInput, type ArchiveObjectType, BufferDumpWriter, COMPLETE_TRANSITIONS, CompleteToken, DEFENSIVE_WARNING_COMMENT, type DotCommandPolicy, type DroppableKind, type DumpArchiveInspection, type DumpMode, type DumpObjectKinds, type DumpProgressCallback, type DumpProgressEvent, type DumpProgressPhase, type DumpProgressSection, type DumpResult, type DumpSection, type DumpSelection, type DumpSqliteOptions, type DumpWriter, type InspectDumpArchiveOptions, type IntrospectSqliteOptions, InvalidTextEncodingError, MalformedSqlDumpError, type NormalizedDumpSelection, OperationCancelledError, type ParsedStatement, type PlainSqlRenderOptions, type PlainSqlRenderRequest, type PlainSqlRenderResult, type PreflightRestoreReport, type PreflightRestoreRequest, type ResolvedPlainSqlRenderOptions, RestoreError, RestoreExecutionError, type RestoreOptions, type RestoreProgressCallback, type RestoreProgressEvent, type RestoreProgressPhase, RestoreSessionState, type RestoreStatementError, type RestoreWarning, SEQUENCE_TABLE_NAME, SESSION_GUARD_FOOTER, SESSION_GUARD_HEADER, SQLITE_KEYWORD_COUNT, type SkippedDotCommand, SqlChunkBuilder, type SqlDumpRestoreRequest, type SqlDumpRestoreResult, type SqlDumpSource, SqlParseError, SqlStatementParser, type SqlStatementParserOptions, type SqliteCapabilities, type SqliteColumn, type SqliteColumnHidden, SqliteConnection, SqliteConnectionInput, type SqliteConsistencyMode, type SqliteDatabase, type SqliteDiagnostic, type SqliteDiagnosticSeverity, type SqliteDumpSession, type SqliteDumpSessionOptions, SqliteDumperError, SqliteErrorInfo, SqliteExecResult, type SqliteForeignKey, type SqliteForeignKeyColumn, type SqliteIndex, type SqliteIndexColumn, type SqliteIntrospectionResult, type SqliteObjectKind, type SqliteObjectReference, SqliteRow, type SqliteSequence, type SqliteTable, type SqliteTableKind, type SqliteTrigger, type SqliteVersion, type SqliteView, type StatementInfo, type StatementSourceLocation, StatementTooLargeError, StreamDumpWriter, type TableDataExportOptions, type TableDataExportRequest, type TableDataExportResult, type TargetCapabilities, type TargetCompatibilityOptions, type TextLiteralStyle, UNSUPPORTED_FEATURES, type UnsatisfiedDependency, UnsupportedClientCommandError, WRITABLE_SCHEMA_OFF, WRITABLE_SCHEMA_ON, acquireSqliteConnection, assignDumpSection, beginSqliteDumpSession, checkTargetCompatibility, classifyWord, columnValueSelect, completeTransition, createArchiveIdentity, createCanonicalIdentity, createDumpId, declaresAutoincrement, decodeStatementBytes, describeStatement, detectSqliteCapabilities, detectSqliteVersion, detectSqliteCapabilities as detectTargetCapabilities, dumpSectionPriority, dumpSqlite, executeStatement, exportTableDataAsInserts, foldSqliteName, insertableColumns, inspectDumpArchive, introspectSqlite, isAbortError, isCompleteStatement, isIdentifierCharCode, isIndexSelected, isSchemaTableName, isSqliteDump, isSqliteKeyword, isStatisticsTableName, isTableDataExcluded, isTableSelected, isTriggerSelected, isTruthyPragmaValue, isViewSelected, maskSqlLiterals, needsIdentifierQuoting, normalizeDumpSelection, parseSqlStatements, parseSqliteVersion, parseTableOptions, parseVirtualTableModule, preflightRestore, preservableRowidName, quoteIdentifier, quoteIdentifierIfNeeded, quoteQualifiedIdentifier, quoteStringLiteral, redactSecrets, renderBlobLiteral, renderColumnLiteral, renderDatabaseSettings, renderDrop, renderEscapedStringLiteral, renderPlainSql, renderQuotedStringLiteral, renderSchemaLine, renderSchemaObject, renderSystemTablePrelude, renderTextLiteral, renderVirtualTable, resolvePlainSqlRenderOptions, restoreSqlDump, safeSqlPreview, streamSqlStatements, streamWithParser, tableGroupPriority, throwIfAborted, toAsciiLowerCase, toAsciiUpperCase, toByteStringChunks, toNumber, toText, unsupportedFeatureDiagnostics };
1927
+ export { AcquiredSqliteConnection, type ArchiveCycle, type ArchiveDependency, type ArchiveDependencyStrength, type ArchiveEntry, type ArchiveIdentityInput, type ArchiveObjectType, BufferDumpWriter, COMPLETE_TRANSITIONS, CompleteToken, DEFENSIVE_WARNING_COMMENT, type DotCommandPolicy, type DroppableKind, type DumpArchiveInspection, type DumpMode, type DumpObjectKinds, type DumpProgressCallback, type DumpProgressEvent, type DumpProgressPhase, type DumpProgressSection, type DumpResult, type DumpSection, type DumpSelection, type DumpSqliteOptions, type DumpWriter, type InspectDumpArchiveOptions, type IntrospectSqliteOptions, InvalidTextEncodingError, MalformedSqlDumpError, NATIVE_VALUE_TRANSPORT, type NormalizedDumpSelection, type ParsedStatement, type PlainSqlRenderOptions, type PlainSqlRenderRequest, type PlainSqlRenderResult, type PreflightRestoreReport, type PreflightRestoreRequest, type ResolvedConnectionFeatures, type ResolvedPlainSqlRenderOptions, RestoreError, RestoreExecutionError, type RestoreOptions, type RestoreProgressCallback, type RestoreProgressEvent, type RestoreProgressPhase, RestoreSessionState, type RestoreStatementError, type RestoreWarning, SEQUENCE_TABLE_NAME, SESSION_GUARD_FOOTER, SESSION_GUARD_HEADER, SQLITE_KEYWORD_COUNT, type SkippedDotCommand, SqlChunkBuilder, type SqlDumpRestoreRequest, type SqlDumpRestoreResult, type SqlDumpSource, SqlParseError, SqlStatementParser, type SqlStatementParserOptions, type SqliteCapabilities, type SqliteColumn, type SqliteColumnHidden, SqliteConnection, SqliteConnectionInput, type SqliteConsistencyMode, type SqliteDatabase, type SqliteDiagnostic, type SqliteDiagnosticSeverity, type SqliteDumpSession, type SqliteDumpSessionOptions, SqliteDumperError, SqliteErrorInfo, SqliteExecResult, type SqliteForeignKey, type SqliteForeignKeyColumn, type SqliteIndex, type SqliteIndexColumn, type SqliteIntrospectionResult, type SqliteObjectKind, type SqliteObjectReference, SqliteRow, type SqliteSequence, type SqliteTable, type SqliteTableKind, type SqliteTrigger, type SqliteValueTransport, type SqliteVersion, type SqliteView, type StatementInfo, type StatementSourceLocation, StatementTooLargeError, StreamDumpWriter, type TableDataExportOptions, type TableDataExportRequest, type TableDataExportResult, type TargetCapabilities, type TargetCompatibilityOptions, type TextLiteralStyle, UNSUPPORTED_FEATURES, type UnsatisfiedDependency, UnsupportedClientCommandError, WRITABLE_SCHEMA_OFF, WRITABLE_SCHEMA_ON, acquireSqliteConnection, assignDumpSection, beginSqliteDumpSession, checkTargetCompatibility, classifyWord, columnValueSelect, completeTransition, connectionFeatures, createArchiveIdentity, createCanonicalIdentity, createDumpId, declaresAutoincrement, decodeStatementBytes, describeStatement, detectSqliteCapabilities, detectSqliteVersion, detectSqliteCapabilities as detectTargetCapabilities, dumpSectionPriority, dumpSqlite, executeStatement, exportTableDataAsInserts, foldSqliteName, insertableColumns, inspectDumpArchive, introspectSqlite, isCompleteStatement, isIdentifierCharCode, isIndexSelected, isSchemaTableName, isSqliteDump, isSqliteKeyword, isStatisticsTableName, isTableDataExcluded, isTableSelected, isTriggerSelected, isTruthyPragmaValue, isViewSelected, maskSqlLiterals, needsIdentifierQuoting, normalizeDumpSelection, parseSqlStatements, parseSqliteVersion, parseTableOptions, parseVirtualTableModule, preflightRestore, preservableRowidName, quoteIdentifier, quoteIdentifierIfNeeded, quoteQualifiedIdentifier, quoteStringLiteral, redactSecrets, renderBlobLiteral, renderColumnLiteral, renderDatabaseSettings, renderDrop, renderEscapedStringLiteral, renderPlainSql, renderQuotedStringLiteral, renderSchemaLine, renderSchemaObject, renderSystemTablePrelude, renderTextLiteral, renderVirtualTable, resolvePlainSqlRenderOptions, restoreSqlDump, safeSqlPreview, streamSqlStatements, streamWithParser, tableGroupPriority, toAsciiLowerCase, toAsciiUpperCase, toBuffer, toByteStringChunks, toNumber, toText, unsupportedFeatureDiagnostics, valueTransport };