@event-driven-io/dumbo 0.13.0-beta.32 → 0.13.0-beta.34
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/{chunk-4SM4JJJZ.js → chunk-33P5766L.js} +2 -2
- package/dist/{chunk-GVR3PSDL.cjs → chunk-4MMMEDQ7.cjs} +180 -85
- package/dist/chunk-4MMMEDQ7.cjs.map +1 -0
- package/dist/{chunk-CMHMR5VO.js → chunk-6HAHSSPW.js} +158 -168
- package/dist/chunk-6HAHSSPW.js.map +1 -0
- package/dist/{chunk-UA542GT3.cjs → chunk-GNH5XC6D.cjs} +43 -43
- package/dist/{chunk-UA542GT3.cjs.map → chunk-GNH5XC6D.cjs.map} +1 -1
- package/dist/{chunk-JKE6SULM.js → chunk-H2JBS7HM.js} +163 -68
- package/dist/chunk-H2JBS7HM.js.map +1 -0
- package/dist/{chunk-J2S3DPDR.cjs → chunk-JIZGCEPE.cjs} +216 -226
- package/dist/chunk-JIZGCEPE.cjs.map +1 -0
- package/dist/{chunk-MOPKHYYU.cjs → chunk-NJI6PJFZ.cjs} +6 -6
- package/dist/{chunk-MOPKHYYU.cjs.map → chunk-NJI6PJFZ.cjs.map} +1 -1
- package/dist/{chunk-HZM7GDOT.cjs → chunk-RQ3KKMTP.cjs} +4 -4
- package/dist/{chunk-HZM7GDOT.cjs.map → chunk-RQ3KKMTP.cjs.map} +1 -1
- package/dist/{chunk-WLWELSA2.js → chunk-UK7MXVS2.js} +2 -2
- package/dist/{chunk-RA2L3FQW.js → chunk-Y5TD53QE.js} +2 -2
- package/dist/cloudflare.cjs +60 -60
- package/dist/cloudflare.js +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.js +3 -3
- package/dist/pg.cjs +37 -37
- package/dist/pg.js +3 -3
- package/dist/postgresql.cjs +4 -4
- package/dist/postgresql.js +3 -3
- package/dist/sqlite.cjs +4 -4
- package/dist/sqlite.d.cts +16 -15
- package/dist/sqlite.d.ts +16 -15
- package/dist/sqlite.js +3 -3
- package/dist/sqlite3.cjs +29 -29
- package/dist/sqlite3.js +3 -3
- package/package.json +15 -14
- package/dist/chunk-CMHMR5VO.js.map +0 -1
- package/dist/chunk-GVR3PSDL.cjs.map +0 -1
- package/dist/chunk-J2S3DPDR.cjs.map +0 -1
- package/dist/chunk-JKE6SULM.js.map +0 -1
- /package/dist/{chunk-4SM4JJJZ.js.map → chunk-33P5766L.js.map} +0 -0
- /package/dist/{chunk-WLWELSA2.js.map → chunk-UK7MXVS2.js.map} +0 -0
- /package/dist/{chunk-RA2L3FQW.js.map → chunk-Y5TD53QE.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-JIZGCEPE.cjs","../src/storage/sqlite/core/errors/errorMapper.ts","../src/storage/sqlite/core/sql/processors/columProcessors.ts","../src/storage/sqlite/core/sql/formatter/index.ts","../src/storage/sqlite/core/execute/execute.ts","../src/storage/sqlite/core/connections/connectionString.ts","../src/storage/sqlite/core/connections/index.ts","../src/storage/sqlite/core/transactions/index.ts","../src/storage/sqlite/core/pool/dualPool.ts","../src/storage/sqlite/core/pool/pool.ts","../src/storage/sqlite/core/schema/migrations.ts","../src/storage/sqlite/core/index.ts"],"names":["serializer","connectionOptions"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACVA,IAAM,mBAAA,EAAqB,CAAC,KAAA,EAAA,GAAuC;AACjE,EAAA,GAAA,CACE,MAAA,WAAiB,MAAA,GACjB,OAAA,GAAU,MAAA,GACV,OAAQ,KAAA,CAAkC,KAAA,IAAS,QAAA,EACnD;AACA,IAAA,OAAQ,KAAA,CAAkC,IAAA;AAAA,EAC5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,EAAA;AACzD,IAAA;AAC8D,IAAA;AAC/D,EAAA;AACH;AAwCiE;AAChC,EAAA;AACc,EAAA;AAEF,EAAA;AACP,IAAA;AAIpC,EAAA;AAEgB,EAAA;AACoB,IAAA;AAIpC,EAAA;AAEwB,EAAA;AACY,IAAA;AAIpC,EAAA;AAE6B,EAAA;AAI/B;AAOoC;AACX,EAAA;AAOnB,EAAA;AAEuD,IAAA;AACvD,MAAA;AAKE,MAAA;AACH,IAAA;AAEoC,EAAA;AAC9B,IAAA;AACL,MAAA;AACF,IAAA;AACF,EAAA;AAUE,EAAA;AACqC,IAAA;AACnC,MAAA;AAOI,MAAA;AAME,QAAA;AACJ,MAAA;AACH,IAAA;AACH,EAAA;AAEqC,EAAA;AACnC,IAAA;AAOI,IAAA;AAME,MAAA;AACJ,IAAA;AACH,EAAA;AACH;AT0XmF;AACA;AUvpBrB;AAEO;AVwpBc;AACA;AWrpBjD;AXupBiD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-JIZGCEPE.cjs","sourcesContent":[null,"import {\n CheckViolationError,\n ConnectionError,\n DataError,\n DeadlockError,\n DumboError,\n ForeignKeyViolationError,\n InsufficientResourcesError,\n IntegrityConstraintViolationError,\n InvalidOperationError,\n LockNotAvailableError,\n NotNullViolationError,\n SerializationError,\n SystemError,\n UniqueConstraintError,\n} from '../../../../core/errors';\n\n/**\n * Extracts the SQLite error code string from a `sqlite3` driver error.\n *\n * The `sqlite3` (node-sqlite3) driver sets `error.code` to a string like\n * `'SQLITE_CONSTRAINT'` and `error.errno` to the numeric result code.\n * See: https://github.com/TryGhost/node-sqlite3\n */\nconst getSqliteErrorCode = (error: unknown): string | undefined => {\n if (\n error instanceof Error &&\n 'code' in error &&\n typeof (error as Record<string, unknown>).code === 'string'\n ) {\n return (error as Record<string, unknown>).code as string;\n }\n return undefined;\n};\n\nconst getErrorMessage = (error: unknown): string | undefined =>\n error instanceof Error ? error.message : undefined;\n\nconst asError = (error: unknown): Error | undefined =>\n error instanceof Error ? error : undefined;\n\n/**\n * Maps a constraint error to a specific DumboError subtype by inspecting the\n * error message. The `sqlite3` driver only exposes the primary result code\n * `SQLITE_CONSTRAINT` — the constraint subtype (UNIQUE, FOREIGN KEY, etc.)\n * is embedded in the message string by SQLite, e.g.:\n * \"SQLITE_CONSTRAINT: UNIQUE constraint failed: users.email\"\n *\n * Reference: https://www.sqlite.org/rescode.html (extended result codes 275–3091)\n */\nconst mapConstraintError = (\n message: string | undefined,\n innerError: Error | undefined,\n): DumboError => {\n const upperMessage = message?.toUpperCase() ?? '';\n\n // SQLITE_CONSTRAINT_UNIQUE (2067) / SQLITE_CONSTRAINT_PRIMARYKEY (1555)\n if (upperMessage.includes('UNIQUE') || upperMessage.includes('PRIMARY KEY'))\n return new UniqueConstraintError(message, innerError);\n\n // SQLITE_CONSTRAINT_FOREIGNKEY (787)\n if (upperMessage.includes('FOREIGN KEY'))\n return new ForeignKeyViolationError(message, innerError);\n\n // SQLITE_CONSTRAINT_NOTNULL (1299)\n if (upperMessage.includes('NOT NULL'))\n return new NotNullViolationError(message, innerError);\n\n // SQLITE_CONSTRAINT_CHECK (275)\n if (upperMessage.includes('CHECK'))\n return new CheckViolationError(message, innerError);\n\n // SQLITE_CONSTRAINT_ROWID (2579), SQLITE_CONSTRAINT_TRIGGER (1811),\n // SQLITE_CONSTRAINT_COMMITHOOK (531), SQLITE_CONSTRAINT_PINNED (2835),\n // SQLITE_CONSTRAINT_DATATYPE (3091), etc.\n return new IntegrityConstraintViolationError(message, innerError);\n};\n\n/**\n * Maps a SQLite error (from the `sqlite3` / node-sqlite3 driver) to a typed\n * DumboError based on the SQLite result code.\n *\n * Result code reference: https://www.sqlite.org/rescode.html\n *\n * Falls back to a generic DumboError (500) if the error is not a recognized SQLite error.\n */\nexport const mapSqliteError = (error: unknown): DumboError => {\n if (DumboError.isInstanceOf<DumboError>(error)) return error;\n\n const code = getSqliteErrorCode(error);\n if (!code)\n return new DumboError({\n errorCode: 500,\n message: getErrorMessage(error),\n innerError: asError(error),\n });\n\n const message = getErrorMessage(error);\n const innerError = asError(error);\n\n switch (code) {\n // ── Constraint violations (19) ──\n // node-sqlite3 only exposes the primary code; subtype is in the message.\n case 'SQLITE_CONSTRAINT':\n return mapConstraintError(message, innerError);\n\n // ── Busy / lock contention ──\n // SQLITE_BUSY (5): conflict with a separate database connection\n case 'SQLITE_BUSY':\n return new LockNotAvailableError(message, innerError);\n\n // SQLITE_LOCKED (6): conflict within the same connection or shared cache\n case 'SQLITE_LOCKED':\n return new DeadlockError(message, innerError);\n\n // SQLITE_PROTOCOL (15): WAL locking race condition\n case 'SQLITE_PROTOCOL':\n return new LockNotAvailableError(message, innerError);\n\n // ── Connection / open errors ──\n // SQLITE_CANTOPEN (14): unable to open database file\n case 'SQLITE_CANTOPEN':\n return new ConnectionError(message, innerError);\n\n // SQLITE_NOTADB (26): file is not a database\n case 'SQLITE_NOTADB':\n return new ConnectionError(message, innerError);\n\n // ── Resource exhaustion ──\n // SQLITE_NOMEM (7): out of memory\n case 'SQLITE_NOMEM':\n return new InsufficientResourcesError(message, innerError);\n\n // SQLITE_FULL (13): disk full\n case 'SQLITE_FULL':\n return new InsufficientResourcesError(message, innerError);\n\n // ── System / I/O errors ──\n // SQLITE_IOERR (10): operating system I/O error\n case 'SQLITE_IOERR':\n return new SystemError(message, innerError);\n\n // SQLITE_CORRUPT (11): database file is corrupted\n case 'SQLITE_CORRUPT':\n return new SystemError(message, innerError);\n\n // SQLITE_INTERNAL (2): internal SQLite malfunction\n case 'SQLITE_INTERNAL':\n return new SystemError(message, innerError);\n\n // SQLITE_NOLFS (22): large file support unavailable\n case 'SQLITE_NOLFS':\n return new SystemError(message, innerError);\n\n // ── Data errors ──\n // SQLITE_TOOBIG (18): string or BLOB too large\n case 'SQLITE_TOOBIG':\n return new DataError(message, innerError);\n\n // SQLITE_MISMATCH (20): datatype mismatch\n case 'SQLITE_MISMATCH':\n return new DataError(message, innerError);\n\n // SQLITE_RANGE (25): bind parameter index out of range\n case 'SQLITE_RANGE':\n return new DataError(message, innerError);\n\n // ── Invalid operations ──\n // SQLITE_ERROR (1): generic SQL error (syntax errors, missing tables, etc.)\n case 'SQLITE_ERROR':\n return new InvalidOperationError(message, innerError);\n\n // SQLITE_READONLY (8): attempt to write to a read-only database\n case 'SQLITE_READONLY':\n return new InvalidOperationError(message, innerError);\n\n // SQLITE_MISUSE (21): API misuse\n case 'SQLITE_MISUSE':\n return new InvalidOperationError(message, innerError);\n\n // SQLITE_AUTH (23): authorization denied\n case 'SQLITE_AUTH':\n return new InvalidOperationError(message, innerError);\n\n // SQLITE_PERM (3): access permission denied\n case 'SQLITE_PERM':\n return new InvalidOperationError(message, innerError);\n\n // SQLITE_SCHEMA (17): schema changed, statement needs re-preparation\n case 'SQLITE_SCHEMA':\n return new InvalidOperationError(message, innerError);\n\n // ── Transaction / abort ──\n // SQLITE_ABORT (4): operation aborted (e.g. by rollback)\n case 'SQLITE_ABORT':\n return new SerializationError(message, innerError);\n\n // SQLITE_INTERRUPT (9): operation interrupted\n case 'SQLITE_INTERRUPT':\n return new SerializationError(message, innerError);\n }\n\n return new DumboError({\n errorCode: 500,\n message,\n innerError,\n });\n};\n","import {\n mapDefaultSQLColumnProcessors,\n type DefaultSQLColumnProcessors,\n type DefaultSQLColumnToken,\n type SQLProcessorContext,\n} from '../../../../../core';\n\nconst mapColumnType = (\n token: DefaultSQLColumnToken,\n { builder }: SQLProcessorContext,\n): void => {\n let columnSQL: string;\n const { sqlTokenType } = token;\n switch (sqlTokenType) {\n case 'SQL_COLUMN_AUTO_INCREMENT':\n columnSQL = `INTEGER ${token.primaryKey ? 'PRIMARY KEY' : ''} AUTOINCREMENT`;\n break;\n case 'SQL_COLUMN_BIGINT':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_SERIAL':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_INTEGER':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_JSONB':\n columnSQL = 'BLOB';\n break;\n case 'SQL_COLUMN_BIGSERIAL':\n columnSQL = 'INTEGER';\n break;\n case 'SQL_COLUMN_TIMESTAMP':\n columnSQL = 'DATETIME';\n break;\n case 'SQL_COLUMN_TIMESTAMPTZ':\n columnSQL = 'DATETIME';\n break;\n case 'SQL_COLUMN_VARCHAR':\n columnSQL = `VARCHAR ${Number.isNaN(token.length) ? '' : `(${token.length})`}`;\n break;\n default: {\n const exhaustiveCheck: never = sqlTokenType;\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unknown column type: ${exhaustiveCheck}`);\n }\n }\n builder.addSQL(columnSQL);\n};\n\nexport const sqliteColumnProcessors: DefaultSQLColumnProcessors =\n mapDefaultSQLColumnProcessors(mapColumnType);\n","import {\n defaultProcessorsRegistry,\n registerFormatter,\n SQLFormatter,\n SQLProcessorsRegistry,\n} from '../../../../../core/sql';\nimport { sqliteColumnProcessors } from '../processors';\n\nconst sqliteSQLProcessorsRegistry = SQLProcessorsRegistry({\n from: defaultProcessorsRegistry,\n}).register(sqliteColumnProcessors);\n\nconst sqliteFormatter: SQLFormatter = SQLFormatter({\n processorsRegistry: sqliteSQLProcessorsRegistry,\n});\n\nregisterFormatter('SQLite', sqliteFormatter);\n\nexport { sqliteFormatter };\n","import type { SQLiteDriverType } from '..';\nimport type { JSONSerializer, SQLFormatter, SQL } from '../../../../core';\nimport {\n mapSQLQueryResult,\n tracer,\n type BatchSQLCommandOptions,\n type DbSQLExecutor,\n type QueryResult,\n type QueryResultRow,\n type SQLCommandOptions,\n type SQLQueryOptions,\n} from '../../../../core';\nimport type { DumboError } from '../../../../core/errors';\nimport type { SQLiteClient } from '../connections';\nimport { mapSqliteError } from '../errors/errorMapper';\nimport { sqliteFormatter } from '../sql/formatter';\n\nexport type SQLiteErrorMapper = (error: unknown) => DumboError;\n\nexport const sqliteExecute = async <Result = void>(\n database: SQLiteClient,\n handle: (client: SQLiteClient) => Promise<Result>,\n) => {\n try {\n return await handle(database);\n } finally {\n await database.close();\n }\n};\n\nexport type SQLiteSQLExecutor<\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n> = DbSQLExecutor<DriverType, SQLiteClient>;\n\nexport const sqliteSQLExecutor = <\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n>(\n driverType: DriverType,\n serializer: JSONSerializer,\n formatter?: SQLFormatter,\n errorMapper?: SQLiteErrorMapper,\n): SQLiteSQLExecutor<DriverType> => ({\n driverType,\n query: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sql: SQL,\n options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>> => {\n tracer.info('db:sql:query', {\n query: (formatter ?? sqliteFormatter).format(sql, { serializer }).query,\n params: (formatter ?? sqliteFormatter).format(sql, { serializer }).params,\n debugSQL: (formatter ?? sqliteFormatter).describe(sql, { serializer }),\n });\n\n try {\n let result = await client.query<Result>(sql, options);\n\n if (options?.mapping) {\n result = {\n ...result,\n rows: result.rows.map((row) =>\n mapSQLQueryResult(row, options.mapping!),\n ),\n };\n }\n\n return result;\n } catch (error) {\n tracer.error('db:sql:query:execute:error', { error });\n throw (errorMapper ?? mapSqliteError)(error);\n }\n },\n batchQuery: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sqls: SQL[],\n options?: SQLQueryOptions,\n ): Promise<QueryResult<Result>[]> => {\n try {\n const results = await client.batchQuery<Result>(sqls, options);\n\n if (options?.mapping) {\n return results.map((result) => ({\n ...result,\n rows: result.rows.map((row) =>\n mapSQLQueryResult(row, options.mapping!),\n ),\n }));\n }\n\n return results;\n } catch (error) {\n tracer.error('db:sql:batch_query:execute:error', { error });\n throw (errorMapper ?? mapSqliteError)(error);\n }\n },\n command: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sql: SQL,\n options?: SQLCommandOptions,\n ): Promise<QueryResult<Result>> => {\n tracer.info('db:sql:command', {\n query: (formatter ?? sqliteFormatter).format(sql, { serializer }).query,\n params: (formatter ?? sqliteFormatter).format(sql, { serializer }).params,\n debugSQL: (formatter ?? sqliteFormatter).describe(sql, { serializer }),\n });\n\n try {\n return await client.command<Result>(sql, options);\n } catch (error) {\n tracer.error('db:sql:command:execute:error', { error });\n throw (errorMapper ?? mapSqliteError)(error);\n }\n },\n batchCommand: async <Result extends QueryResultRow = QueryResultRow>(\n client: SQLiteClient,\n sqls: SQL[],\n options?: BatchSQLCommandOptions,\n ): Promise<QueryResult<Result>[]> => {\n try {\n return await client.batchCommand<Result>(sqls, options);\n } catch (error) {\n tracer.error('db:sql:batch_command:execute:error', { error });\n throw (errorMapper ?? mapSqliteError)(error);\n }\n },\n formatter: formatter ?? sqliteFormatter,\n});\n","import type { DatabaseConnectionString } from '../../../all';\n\nexport type SQLitePragmaOptions = {\n journal_mode?: 'DELETE' | 'TRUNCATE' | 'PERSIST' | 'MEMORY' | 'WAL' | 'OFF';\n synchronous?: 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';\n cache_size?: number;\n foreign_keys?: boolean;\n temp_store?: 'DEFAULT' | 'FILE' | 'MEMORY';\n busy_timeout?: number;\n mmap_size?: number;\n};\n\nexport type SQLiteConnectionString = DatabaseConnectionString<\n 'SQLite',\n `file:${string}` | `:memory:` | `/${string}` | `./${string}`\n>;\n\nexport const SQLiteConnectionString = (\n connectionString: string,\n): SQLiteConnectionString => {\n if (\n !connectionString.startsWith('file:') &&\n connectionString !== ':memory:' &&\n !connectionString.startsWith('/') &&\n !connectionString.startsWith('./')\n ) {\n throw new Error(\n `Invalid SQLite connection string: ${connectionString}. It should start with \"file:\", \":memory:\", \"/\", or \"./\".`,\n );\n }\n return connectionString as SQLiteConnectionString;\n};\n\nexport const parsePragmasFromConnectionString = (\n connectionString: string | SQLiteConnectionString,\n): Partial<SQLitePragmaOptions> => {\n const str = String(connectionString);\n\n if (!str.startsWith('file:')) {\n return {};\n }\n\n const url = new URL(str);\n const params = url.searchParams;\n const pragmas: Partial<SQLitePragmaOptions> = {};\n\n const journalMode = params.get('journal_mode');\n if (journalMode !== null) {\n pragmas.journal_mode = journalMode as\n | 'DELETE'\n | 'TRUNCATE'\n | 'PERSIST'\n | 'MEMORY'\n | 'WAL'\n | 'OFF';\n }\n\n const synchronous = params.get('synchronous');\n if (synchronous !== null) {\n pragmas.synchronous = synchronous as 'OFF' | 'NORMAL' | 'FULL' | 'EXTRA';\n }\n\n const cacheSize = params.get('cache_size');\n if (cacheSize !== null) {\n pragmas.cache_size = parseInt(cacheSize, 10);\n }\n\n const foreignKeys = params.get('foreign_keys');\n if (foreignKeys !== null) {\n const val = foreignKeys.toLowerCase();\n pragmas.foreign_keys = val === 'true' || val === 'on' || val === '1';\n }\n\n const tempStore = params.get('temp_store');\n if (tempStore !== null) {\n pragmas.temp_store = tempStore.toUpperCase() as\n | 'DEFAULT'\n | 'FILE'\n | 'MEMORY';\n }\n\n const busyTimeout = params.get('busy_timeout');\n if (busyTimeout !== null) {\n pragmas.busy_timeout = parseInt(busyTimeout, 10);\n }\n\n const mmapSize = params.get('mmap_size');\n if (mmapSize !== null) {\n pragmas.mmap_size = parseInt(mmapSize, 10);\n }\n\n return pragmas;\n};\n","import type { SQLiteDriverType } from '..';\nimport type { JSONSerializer } from '../../../../core';\nimport {\n createAmbientConnection,\n createConnection,\n type AnyConnection,\n type BatchSQLCommandOptions,\n type Connection,\n type ConnectionOptions,\n type DatabaseTransaction,\n type InferDbClientFromConnection,\n type InferDriverTypeFromConnection,\n type InitTransaction,\n type SQLCommandOptions,\n type SQLExecutor,\n} from '../../../../core';\nimport { mapSqliteError } from '../errors';\nimport { sqliteSQLExecutor, type SQLiteErrorMapper } from '../execute';\nimport { sqliteTransaction, type SQLiteTransactionMode } from '../transactions';\nimport {\n SQLiteConnectionString,\n type SQLitePragmaOptions,\n} from './connectionString';\n\nexport type SQLiteCommandOptions = SQLCommandOptions & {\n ignoreChangesCount?: boolean;\n};\n\nexport type BatchSQLiteCommandOptions = SQLiteCommandOptions &\n BatchSQLCommandOptions;\n\nexport type SQLiteParameters =\n | object\n | string\n | bigint\n | number\n | boolean\n | null;\n\nexport type SQLiteClient = {\n connect: () => Promise<void>;\n close: () => Promise<void>;\n} & SQLExecutor;\n\nexport type SQLitePoolClient = {\n release: () => void;\n} & SQLExecutor;\n\nexport type SQLiteClientFactory<\n SQLiteClientType extends SQLiteClient = SQLiteClient,\n ClientOptions = SQLiteClientOptions,\n> = (options: ClientOptions) => SQLiteClientType;\n\nexport type SQLiteClientOrPoolClient = SQLitePoolClient | SQLiteClient;\n\nexport interface SQLiteError extends Error {\n errno: number;\n}\n\nexport const isSQLiteError = (error: unknown): error is SQLiteError => {\n if (error instanceof Error && 'code' in error) {\n return true;\n }\n\n return false;\n};\n\nexport type SQLiteClientConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLiteClientType extends SQLiteClient = SQLiteClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n> = Connection<Self, DriverType, SQLiteClientType, TransactionType>;\n\nexport type SQLitePoolClientConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLitePoolClientType extends SQLitePoolClient = SQLitePoolClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n> = Connection<Self, DriverType, SQLitePoolClientType, TransactionType>;\n\nexport type SQLiteConnection<\n Self extends AnyConnection = AnyConnection,\n DriverType extends SQLiteDriverType = SQLiteDriverType,\n SQLiteClientType extends SQLiteClientOrPoolClient =\n | SQLiteClient\n | SQLitePoolClient,\n TransactionType extends DatabaseTransaction<Self> = DatabaseTransaction<Self>,\n> =\n | (SQLiteClientType extends SQLiteClient\n ? SQLiteClientConnection<\n Self,\n DriverType,\n SQLiteClientType,\n TransactionType\n >\n : never)\n | (SQLiteClientType extends SQLitePoolClient\n ? SQLitePoolClientConnection<\n Self,\n DriverType,\n SQLiteClientType,\n TransactionType\n >\n : never);\n\nexport type AnySQLiteClientConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLiteClientConnection<any, any>;\n\nexport type AnySQLitePoolClientConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLitePoolClientConnection<any, any, any, any>;\n\nexport type AnySQLiteConnection =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SQLiteConnection<any, any, any, any>;\n\nexport type SQLiteConnectionOptions<\n ConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionOptions<ConnectionType> & SQLiteClientOptions;\n\nexport type SQLiteClientConnectionDefinitionOptions<\n SQLiteConnectionType extends AnySQLiteClientConnection =\n AnySQLiteClientConnection,\n ConnectionOptions = SQLiteConnectionOptions,\n> = {\n driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;\n type: 'Client';\n sqliteClientFactory: SQLiteClientFactory<\n InferDbClientFromConnection<SQLiteConnectionType>,\n ConnectionOptions\n >;\n connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;\n serializer: JSONSerializer;\n};\n\nexport type SQLitePoolConnectionDefinitionOptions<\n SQLiteConnectionType extends AnySQLitePoolClientConnection =\n AnySQLitePoolClientConnection,\n ConnectionOptions = SQLiteConnectionOptions,\n> = {\n driverType: InferDriverTypeFromConnection<SQLiteConnectionType>;\n type: 'PoolClient';\n sqliteClientFactory: SQLiteClientFactory<\n InferDbClientFromConnection<SQLiteConnectionType>,\n ConnectionOptions\n >;\n connectionOptions: SQLiteConnectionOptions<SQLiteConnectionType>;\n serializer: JSONSerializer;\n};\n\nexport type SQLiteConnectionDefinitionOptions<\n SQLiteConnectionType extends AnySQLitePoolClientConnection =\n AnySQLitePoolClientConnection,\n ClientOptions = SQLiteClientOptions,\n> =\n | SQLiteClientConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>\n | SQLitePoolConnectionDefinitionOptions<SQLiteConnectionType, ClientOptions>;\n\nexport type SQLiteConnectionFactory<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = (options: ConnectionOptions) => SQLiteConnectionType;\n\nexport type TransactionNestingCounter = {\n increment: () => void;\n decrement: () => void;\n reset: () => void;\n level: number;\n};\n\nexport const transactionNestingCounter = (): TransactionNestingCounter => {\n let transactionLevel = 0;\n\n return {\n reset: () => {\n transactionLevel = 0;\n },\n increment: () => {\n transactionLevel++;\n },\n decrement: () => {\n transactionLevel--;\n\n if (transactionLevel < 0) {\n throw new Error('Transaction level is out of bounds');\n }\n },\n get level() {\n return transactionLevel;\n },\n };\n};\n\nexport type SqliteAmbientClientConnectionOptions<\n SQLiteConnectionType extends AnySQLiteClientConnection =\n AnySQLiteClientConnection,\n> = {\n driverType: SQLiteConnectionType['driverType'];\n client: InferDbClientFromConnection<SQLiteConnectionType>;\n initTransaction?: InitTransaction<SQLiteConnectionType>;\n allowNestedTransactions?: boolean;\n defaultTransactionMode?: SQLiteTransactionMode;\n serializer: JSONSerializer;\n errorMapper?: SQLiteErrorMapper;\n};\n\nexport const sqliteAmbientClientConnection = <\n SQLiteConnectionType extends AnySQLiteClientConnection =\n AnySQLiteClientConnection,\n>(\n options: SqliteAmbientClientConnectionOptions<SQLiteConnectionType>,\n) => {\n const {\n client,\n driverType,\n initTransaction,\n allowNestedTransactions,\n defaultTransactionMode,\n serializer,\n errorMapper,\n } = options;\n\n return createAmbientConnection<SQLiteConnectionType>({\n driverType,\n client,\n initTransaction:\n initTransaction ??\n ((connection) =>\n sqliteTransaction(\n driverType,\n connection,\n allowNestedTransactions ?? false,\n serializer,\n defaultTransactionMode,\n )),\n executor: ({ serializer }) =>\n sqliteSQLExecutor(driverType, serializer, undefined, errorMapper),\n serializer,\n });\n};\n\nexport const sqliteClientConnection = <\n SQLiteConnectionType extends AnySQLiteClientConnection =\n AnySQLiteClientConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLiteClientConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType => {\n const { connectionOptions, sqliteClientFactory, serializer } = options;\n\n let client: InferDbClientFromConnection<SQLiteConnectionType> | null = null;\n\n const connect = async (): Promise<\n InferDbClientFromConnection<SQLiteConnectionType>\n > => {\n if (client) return Promise.resolve(client);\n\n client = sqliteClientFactory(connectionOptions as ClientOptions);\n\n if (client && 'connect' in client && typeof client.connect === 'function') {\n try {\n await client.connect();\n } catch (error) {\n throw mapSqliteError(error);\n }\n }\n\n return client;\n };\n\n return createConnection({\n driverType: options.driverType,\n connect,\n close: async () => {\n if (client && 'close' in client && typeof client.close === 'function')\n await client.close();\n else if (\n client &&\n 'release' in client &&\n typeof client.release === 'function'\n )\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n client.release();\n },\n initTransaction: (connection) =>\n sqliteTransaction(\n options.driverType,\n connection,\n connectionOptions.transactionOptions?.allowNestedTransactions ?? false,\n serializer,\n connectionOptions.defaultTransactionMode,\n ),\n executor: ({ serializer }) =>\n sqliteSQLExecutor(options.driverType, serializer),\n serializer,\n });\n};\n\nexport const sqlitePoolClientConnection = <\n SQLiteConnectionType extends AnySQLiteClientConnection =\n AnySQLiteClientConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLitePoolConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType => {\n const { connectionOptions, sqliteClientFactory, serializer } = options;\n\n let client: InferDbClientFromConnection<SQLiteConnectionType> | null = null;\n\n const connect = async (): Promise<\n InferDbClientFromConnection<SQLiteConnectionType>\n > => {\n if (client) return Promise.resolve(client);\n\n client = sqliteClientFactory(connectionOptions as ClientOptions);\n\n try {\n await client.connect();\n } catch (error) {\n throw mapSqliteError(error);\n }\n\n return client;\n };\n\n return createConnection({\n driverType: options.driverType,\n connect,\n close: () =>\n client !== null\n ? Promise.resolve((client as unknown as SQLitePoolClient).release())\n : Promise.resolve(),\n initTransaction: (connection) =>\n sqliteTransaction(\n options.driverType,\n connection,\n connectionOptions.transactionOptions?.allowNestedTransactions ?? false,\n serializer,\n connectionOptions.defaultTransactionMode,\n ),\n executor: ({ serializer }) =>\n sqliteSQLExecutor(options.driverType, serializer),\n serializer,\n });\n};\n\nexport function sqliteConnection<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ClientOptions = SQLiteClientOptions,\n>(\n options: SQLiteConnectionDefinitionOptions<\n SQLiteConnectionType,\n ClientOptions\n >,\n): SQLiteConnectionType {\n return options.type === 'Client'\n ? sqliteClientConnection(options)\n : sqlitePoolClientConnection(options);\n}\n\nexport type InMemorySQLiteDatabase = ':memory:';\nexport const InMemorySQLiteDatabase = SQLiteConnectionString(':memory:');\n\nexport type { SQLitePragmaOptions } from './connectionString';\n\nexport const DEFAULT_SQLITE_PRAGMA_OPTIONS: SQLitePragmaOptions = {\n journal_mode: 'WAL',\n synchronous: 'NORMAL',\n cache_size: -1000000,\n foreign_keys: true,\n temp_store: 'MEMORY',\n busy_timeout: 5000,\n mmap_size: 268435456,\n};\n\nexport type SQLiteClientOptions = {\n pragmaOptions?: Partial<SQLitePragmaOptions>;\n defaultTransactionMode?: SQLiteTransactionMode;\n skipDatabasePragmas?: boolean;\n readonly?: boolean;\n};\n\nexport * from './connectionString';\n","import type {\n InferTransactionFromConnection,\n JSONSerializer,\n} from '../../../../core';\nimport {\n SQL,\n sqlExecutor,\n type DatabaseTransaction,\n type DatabaseTransactionOptions,\n type InferDbClientFromConnection,\n} from '../../../../core';\nimport { sqliteSQLExecutor } from '../../core/execute';\nimport {\n transactionNestingCounter,\n type AnySQLiteConnection,\n type SQLiteClientOrPoolClient,\n} from '../connections';\n\nexport type SQLiteTransaction<\n ConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n TransactionOptions extends SQLiteTransactionOptions =\n SQLiteTransactionOptions,\n> = DatabaseTransaction<ConnectionType, TransactionOptions>;\n\nexport type SQLiteTransactionMode = 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE';\n\nexport type SQLiteTransactionOptions = DatabaseTransactionOptions & {\n mode?: SQLiteTransactionMode;\n useSavepoints?: boolean;\n};\n\nexport const sqliteTransaction =\n <ConnectionType extends AnySQLiteConnection = AnySQLiteConnection>(\n driverType: ConnectionType['driverType'],\n connection: () => ConnectionType,\n allowNestedTransactions: boolean,\n serializer: JSONSerializer,\n defaultTransactionMode?: 'IMMEDIATE' | 'DEFERRED' | 'EXCLUSIVE',\n ) =>\n (\n getClient: Promise<InferDbClientFromConnection<ConnectionType>>,\n options?: {\n close: (\n client: InferDbClientFromConnection<ConnectionType>,\n error?: unknown,\n ) => Promise<void>;\n } & SQLiteTransactionOptions,\n ): InferTransactionFromConnection<ConnectionType> => {\n const transactionCounter = transactionNestingCounter();\n allowNestedTransactions =\n options?.allowNestedTransactions ?? allowNestedTransactions;\n\n const transaction: DatabaseTransaction<ConnectionType> = {\n connection: connection(),\n driverType,\n begin: async function () {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n\n if (allowNestedTransactions) {\n if (transactionCounter.level >= 1) {\n transactionCounter.increment();\n if (options?.useSavepoints) {\n await client.command(\n SQL`SAVEPOINT transaction${SQL.plain(transactionCounter.level.toString())}`,\n );\n }\n return;\n }\n\n transactionCounter.increment();\n }\n\n const mode = options?.mode ?? defaultTransactionMode ?? 'IMMEDIATE';\n await client.command(SQL`BEGIN ${SQL.plain(mode)} TRANSACTION`);\n },\n commit: async function () {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n\n try {\n if (allowNestedTransactions) {\n if (transactionCounter.level > 1) {\n if (options?.useSavepoints) {\n await client.command(\n SQL`RELEASE transaction${SQL.plain(transactionCounter.level.toString())}`,\n );\n }\n transactionCounter.decrement();\n\n return;\n }\n\n transactionCounter.reset();\n }\n await client.command(SQL`COMMIT`);\n } finally {\n if (options?.close)\n await options?.close(\n client as InferDbClientFromConnection<ConnectionType>,\n );\n }\n },\n rollback: async function (error?: unknown) {\n const client = (await getClient) as SQLiteClientOrPoolClient;\n try {\n if (allowNestedTransactions) {\n if (transactionCounter.level > 1) {\n transactionCounter.decrement();\n return;\n }\n }\n\n await client.command(SQL`ROLLBACK`);\n } finally {\n if (options?.close)\n await options?.close(\n client as InferDbClientFromConnection<ConnectionType>,\n error,\n );\n }\n },\n execute: sqlExecutor(sqliteSQLExecutor(driverType, serializer), {\n connect: () => getClient,\n }),\n _transactionOptions: options ?? {},\n };\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return transaction as InferTransactionFromConnection<ConnectionType>;\n };\n","import { cpus } from 'os';\nimport {\n createBoundedConnectionPool,\n createSingletonConnectionPool,\n} from '../../../../core';\nimport { guardInitializedOnce } from '../../../../core/taskProcessing';\nimport type {\n AnySQLiteConnection,\n SQLiteConnectionFactory,\n SQLiteConnectionOptions,\n} from '../connections';\nimport { mapSqliteError } from '../errors';\nimport type { SQLitePool } from './pool';\n\nexport type SQLiteDualPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n> = {\n driverType: SQLiteConnectionType['driverType'];\n dual?: true;\n singleton?: false;\n pooled?: true;\n connection?: never;\n readerPoolSize?: number;\n sqliteConnectionFactory: SQLiteConnectionFactory<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n connectionOptions?: ConnectionOptions;\n};\n\nexport const sqliteDualConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n>(\n options: SQLiteDualPoolOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLitePool<SQLiteConnectionType> => {\n const { sqliteConnectionFactory, connectionOptions } = options;\n const readerPoolSize = options.readerPoolSize ?? Math.max(4, cpus().length);\n\n let databaseInitPromise: Promise<void> | null = null;\n\n const guardSingleConnection = guardInitializedOnce(async () => {\n if (databaseInitPromise !== null) {\n return databaseInitPromise;\n }\n\n const initConnection = sqliteConnectionFactory({\n ...connectionOptions,\n skipDatabasePragmas: false,\n readonly: false,\n } as ConnectionOptions);\n\n const initPromise = initConnection.open();\n databaseInitPromise = initPromise;\n\n try {\n await initPromise;\n await initConnection.close();\n } catch (error) {\n databaseInitPromise = null;\n await initConnection.close();\n throw mapSqliteError(error);\n }\n });\n\n const ensureDatabaseInitialized = async (): Promise<void> => {\n if (databaseInitPromise !== null) {\n return databaseInitPromise;\n }\n\n return guardSingleConnection.ensureInitialized();\n };\n\n const wrappedConnectionFactory = async (\n readonly: boolean,\n connectionOptions: ConnectionOptions | undefined,\n ): Promise<SQLiteConnectionType> => {\n await ensureDatabaseInitialized();\n\n const connection = sqliteConnectionFactory({\n ...connectionOptions,\n skipDatabasePragmas: true,\n readonly,\n } as ConnectionOptions);\n\n await connection.open();\n\n return connection;\n };\n\n const writerPool = createSingletonConnectionPool({\n driverType: options.driverType,\n getConnection: () => wrappedConnectionFactory(false, connectionOptions),\n });\n\n const readerPool = createBoundedConnectionPool({\n driverType: options.driverType,\n getConnection: () => wrappedConnectionFactory(true, connectionOptions),\n maxConnections: readerPoolSize,\n });\n\n return {\n driverType: options.driverType,\n connection: (connectionOptions) =>\n connectionOptions?.readonly\n ? readerPool.connection(connectionOptions)\n : writerPool.connection(connectionOptions),\n execute: {\n query: (...args) => readerPool.execute.query(...args),\n batchQuery: (...args) => readerPool.execute.batchQuery(...args),\n command: (...args) => writerPool.execute.command(...args),\n batchCommand: (...args) => writerPool.execute.batchCommand(...args),\n },\n withConnection: (handle, connectionOptions) =>\n connectionOptions?.readonly\n ? readerPool.withConnection(handle, connectionOptions)\n : writerPool.withConnection(handle, connectionOptions),\n transaction: writerPool.transaction,\n withTransaction: writerPool.withTransaction,\n close: async () => {\n await guardSingleConnection.stop();\n await Promise.all([writerPool.close(), readerPool.close()]);\n },\n };\n};\n","import type { SQLiteConnectionString } from '../connections/connectionString';\nimport {\n InMemorySQLiteDatabase,\n type AnySQLiteConnection,\n type SQLiteConnectionFactory,\n type SQLiteConnectionOptions,\n} from '../connections';\nimport type { JSONSerializer } from '../../../../core';\nimport {\n createAlwaysNewConnectionPool,\n createAmbientConnectionPool,\n createSingletonConnectionPool,\n type ConnectionPool,\n} from '../../../../core';\nimport {\n sqliteDualConnectionPool,\n type SQLiteDualPoolOptions,\n} from './dualPool';\n\nexport type SQLiteFileNameOrConnectionString =\n | {\n fileName: string | SQLiteConnectionString;\n connectionString?: never;\n }\n | {\n connectionString: string | SQLiteConnectionString;\n fileName?: never;\n };\n\nexport const isInMemoryDatabase = (\n options: Record<string, unknown>,\n): boolean => {\n if ('fileName' in options) {\n return options.fileName === InMemorySQLiteDatabase;\n }\n if ('connectionString' in options) {\n return options.connectionString === InMemorySQLiteDatabase;\n }\n return false;\n};\n\nexport type SQLiteAmbientConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\ntype SQLiteAmbientConnectionPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = {\n singleton?: true;\n pooled?: false;\n sqliteConnectionFactory?: never;\n connection: SQLiteConnectionType;\n connectionOptions?: never;\n};\n\nexport const sqliteAmbientConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType['driverType']>,\n): SQLiteAmbientConnectionPool<SQLiteConnectionType['driverType']> => {\n const { connection, driverType } = options;\n\n return createAmbientConnectionPool<SQLiteConnectionType>({\n driverType,\n connection: connection,\n }) as unknown as SQLiteAmbientConnectionPool<\n SQLiteConnectionType['driverType']\n >;\n};\n\ntype SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = {\n singleton: true;\n pooled?: true;\n sqliteConnectionFactory: SQLiteConnectionFactory<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n connection?: never;\n connectionOptions: ConnectionOptions;\n};\n\nexport type SQLiteSingletonConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\nexport const sqliteSingletonConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> =\n SQLiteConnectionOptions & Record<string, unknown>,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >,\n): SQLiteSingletonConnectionPool<SQLiteConnectionType> => {\n const { driverType, sqliteConnectionFactory, connectionOptions } = options;\n\n return createSingletonConnectionPool<SQLiteConnectionType>({\n driverType,\n getConnection: () => sqliteConnectionFactory(connectionOptions),\n }) as unknown as SQLiteSingletonConnectionPool<SQLiteConnectionType>;\n};\n\ntype SQLiteAlwaysNewPoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = {\n singleton?: false;\n pooled?: true;\n sqliteConnectionFactory: SQLiteConnectionFactory<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n connection?: never;\n connectionOptions: ConnectionOptions;\n};\n\nexport type SQLiteAlwaysNewConnectionPool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> = ConnectionPool<SQLiteConnectionType>;\n\nexport const sqliteAlwaysNewConnectionPool = <\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions & Record<string, unknown> =\n SQLiteConnectionOptions & Record<string, unknown>,\n>(\n options: {\n driverType: SQLiteConnectionType['driverType'];\n } & SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLiteAlwaysNewConnectionPool<SQLiteConnectionType> => {\n const { driverType, sqliteConnectionFactory, connectionOptions } = options;\n\n return createAlwaysNewConnectionPool<SQLiteConnectionType>({\n driverType,\n getConnection: () => sqliteConnectionFactory(connectionOptions),\n }) as unknown as SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;\n};\n\nexport type SQLitePoolOptions<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n> = (\n | SQLiteAlwaysNewPoolOptions<SQLiteConnectionType, ConnectionOptions>\n | SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >\n | SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType>\n | SQLiteDualPoolOptions<SQLiteConnectionType, ConnectionOptions>\n) & {\n driverType: SQLiteConnectionType['driverType'];\n serializer?: JSONSerializer;\n};\n\nexport type SQLitePool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n> =\n | SQLiteAmbientConnectionPool<SQLiteConnectionType>\n | SQLiteSingletonConnectionPool<SQLiteConnectionType>\n | SQLiteAlwaysNewConnectionPool<SQLiteConnectionType>;\n\nexport type SQLitePoolFactoryOptions<\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n> = Omit<\n SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>,\n 'singleton'\n> & {\n singleton?: boolean;\n};\n\nexport const toSqlitePoolOptions = <\n SQLiteConnectionType extends AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions,\n>(\n options: SQLitePoolFactoryOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions> => {\n const { singleton, ...rest } = options;\n const isInMemory = isInMemoryDatabase(options);\n\n if ('client' in options && options.client) {\n return { ...rest, singleton: true } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n }\n\n if (isInMemory) {\n return { ...rest, singleton: true } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n }\n\n if (singleton === true) {\n return { ...rest, singleton: true } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n }\n\n return { ...rest, dual: true } as SQLitePoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n >;\n};\n\nexport function sqlitePool<\n SQLiteConnectionType extends AnySQLiteConnection = AnySQLiteConnection,\n ConnectionOptions extends SQLiteConnectionOptions = SQLiteConnectionOptions,\n>(\n options: SQLitePoolOptions<SQLiteConnectionType, ConnectionOptions>,\n): SQLitePool<SQLiteConnectionType> {\n const { driverType } = options;\n\n if (\n (\n options as SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType> & {\n driverType: SQLiteConnectionType['driverType'];\n }\n ).connection\n )\n return createAmbientConnectionPool<SQLiteConnectionType>({\n driverType,\n connection: (\n options as SQLiteAmbientConnectionPoolOptions<SQLiteConnectionType> & {\n driverType: SQLiteConnectionType['driverType'];\n }\n ).connection,\n });\n\n if ('dual' in options && options.dual) {\n return sqliteDualConnectionPool(\n options as SQLiteDualPoolOptions<SQLiteConnectionType, ConnectionOptions>,\n );\n }\n\n if (\n options.singleton === true &&\n (\n options as SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n > & { driverType: SQLiteConnectionType['driverType'] }\n ).sqliteConnectionFactory\n ) {\n return createSingletonConnectionPool({\n driverType,\n getConnection: () =>\n (\n options as SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n > & { driverType: SQLiteConnectionType['driverType'] }\n ).sqliteConnectionFactory(\n (\n options as SQLiteSingletonConnectionPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n > & { driverType: SQLiteConnectionType['driverType'] }\n ).connectionOptions,\n ),\n });\n }\n\n return createAlwaysNewConnectionPool({\n driverType,\n getConnection: () =>\n (\n options as SQLiteAlwaysNewPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n > & { driverType: SQLiteConnectionType['driverType'] }\n ).sqliteConnectionFactory(\n (\n options as SQLiteAlwaysNewPoolOptions<\n SQLiteConnectionType,\n ConnectionOptions\n > & { driverType: SQLiteConnectionType['driverType'] }\n ).connectionOptions,\n ),\n });\n}\n","import {\n registerDefaultMigratorOptions,\n type MigratorOptions,\n} from '../../../../core';\n\nexport const DefaultSQLiteMigratorOptions: MigratorOptions = {};\n\nregisterDefaultMigratorOptions('SQLite', DefaultSQLiteMigratorOptions);\n","import type { DatabaseDriverType } from '../../..';\n\nexport * from './connections';\nexport * from './errors';\nexport * from './execute';\nexport * from './pool';\nexport * from './schema';\nexport * from './sql';\nexport * from './transactions';\n\nexport type SQLiteDatabaseName = 'SQLite';\nexport const SQLiteDatabaseName = 'SQLite';\n\nexport type SQLiteDriverType<DriverName extends string = string> =\n DatabaseDriverType<SQLiteDatabaseName, DriverName>;\n\nexport type SQLiteDatabaseType = 'SQLite';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4MMMEDQ7cjs = require('./chunk-4MMMEDQ7.cjs');
|
|
5
5
|
|
|
6
6
|
// src/storage/postgresql/core/connections/connectionString.ts
|
|
7
7
|
var defaultPostgreSQLConnectionString = "postgresql://postgres@localhost:5432/postgres";
|
|
@@ -40,19 +40,19 @@ function parseDatabaseName(str) {
|
|
|
40
40
|
|
|
41
41
|
// src/storage/postgresql/core/schema/schema.ts
|
|
42
42
|
var defaultPostgreSqlDatabase = "postgres";
|
|
43
|
-
var tableExistsSQL = (tableName) =>
|
|
43
|
+
var tableExistsSQL = (tableName) => _chunk4MMMEDQ7cjs.SQL`
|
|
44
44
|
SELECT EXISTS (
|
|
45
45
|
SELECT FROM pg_tables
|
|
46
46
|
WHERE tablename = ${tableName}
|
|
47
47
|
) AS exists;`;
|
|
48
|
-
var tableExists = async (execute, tableName) =>
|
|
49
|
-
var functionExistsSQL = (functionName) =>
|
|
48
|
+
var tableExists = async (execute, tableName) => _chunk4MMMEDQ7cjs.exists.call(void 0, execute.query(tableExistsSQL(tableName)));
|
|
49
|
+
var functionExistsSQL = (functionName) => _chunk4MMMEDQ7cjs.SQL`
|
|
50
50
|
SELECT EXISTS (
|
|
51
51
|
SELECT FROM pg_proc
|
|
52
52
|
WHERE
|
|
53
53
|
proname = ${functionName}
|
|
54
54
|
) AS exists;`;
|
|
55
|
-
var functionExists = async (execute, functionName) =>
|
|
55
|
+
var functionExists = async (execute, functionName) => _chunk4MMMEDQ7cjs.exists.call(void 0, execute.query(functionExistsSQL(functionName)));
|
|
56
56
|
|
|
57
57
|
// src/storage/postgresql/core/schema/postgreSQLMetadata.ts
|
|
58
58
|
var postgreSQLMetadata = {
|
|
@@ -80,4 +80,4 @@ dumboDatabaseMetadataRegistry.register("PostgreSQL", postgreSQLMetadata);
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
exports.defaultPostgreSQLConnectionString = defaultPostgreSQLConnectionString; exports.PostgreSQLConnectionString = PostgreSQLConnectionString; exports.parseDatabaseName = parseDatabaseName; exports.defaultPostgreSqlDatabase = defaultPostgreSqlDatabase; exports.tableExistsSQL = tableExistsSQL; exports.tableExists = tableExists; exports.functionExistsSQL = functionExistsSQL; exports.functionExists = functionExists; exports.postgreSQLMetadata = postgreSQLMetadata;
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-NJI6PJFZ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-NJI6PJFZ.cjs","../src/storage/postgresql/core/connections/connectionString.ts","../src/storage/postgresql/core/schema/schema.ts","../src/storage/postgresql/core/schema/postgreSQLMetadata.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACHO,IAAM,kCAAA,EACX,+CAAA;AAOK,IAAM,2BAAA,EAA6B,CACxC,gBAAA,EAAA,GAC+B;AAC/B,EAAA,GAAA,CACE,CAAC,gBAAA,CAAiB,UAAA,CAAW,eAAe,EAAA,GAC5C,CAAC,gBAAA,CAAiB,UAAA,CAAW,aAAa,CAAA,EAC1C;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,sCAAA,EAAyC,gBAAgB,CAAA,uCAAA;AAAA,IAC3D,CAAA;AAAA,EACF;AACA,EAAA,OAAO,gBAAA;AACT,CAAA;AAQO,SAAS,iBAAA,CAAkB,GAAA,EAA4B;AAE5D,EAAA,GAAA,CAAI,GAAA,CAAI,MAAA,CAAO,CAAC,EAAA,IAAM,GAAA,EAAK;AACzB,IAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,KAAA,CAAM,GAAG,CAAA;AAC3B,IAAA,OAAO,KAAA,CAAM,CAAC,EAAA,GAAK,IAAA;AAAA,EACrB;AAGA,EAAA,GAAA,CAAI,kCAAA,CAAmC,IAAA,CAAK,GAAG,CAAA,EAAG;AAChD,IAAA,IAAA,EAAM,SAAA,CAAU,GAAG,CAAA,CAAE,OAAA,CAAQ,YAAA,EAAc,KAAK,CAAA;AAAA,EAClD;AAEA,EAAA,IAAI,MAAA;AACJ,EAAA,IAAI;AACF,IAAA,OAAA,EAAS,IAAI,GAAA,CAAI,GAAA,EAAK,iBAAiB,CAAA;AAAA,EACzC,EAAA,UAAQ;AAEN,IAAA,IAAI;AACF,MAAA,OAAA,EAAS,IAAI,GAAA,CAAI,GAAA,CAAI,OAAA,CAAQ,IAAA,EAAM,eAAe,CAAA,EAAG,iBAAiB,CAAA;AAAA,IACxE,EAAA,WAAQ;AACN,MAAA,OAAO,IAAA;AAA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BAAA,EAAmB,iBAAA,CAAkB,gBAAgB,EAAA,EAAI,IAAA,CAAA,UAC1D;AACJ,CAAA;AAEA,6BAAA,CAA8B,QAAA,CAAS,YAAA,EAAc,kBAAkB,CAAA;AH+CvE;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,kdAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-NJI6PJFZ.cjs","sourcesContent":[null,"import type { DatabaseConnectionString } from '../../../all';\n\nexport const defaultPostgreSQLConnectionString: PostgreSQLConnectionString =\n 'postgresql://postgres@localhost:5432/postgres' as PostgreSQLConnectionString;\n\nexport type PostgreSQLConnectionString = DatabaseConnectionString<\n 'PostgreSQL',\n `postgresql://${string}` | `postgres://${string}`\n>;\n\nexport const PostgreSQLConnectionString = (\n connectionString: string,\n): PostgreSQLConnectionString => {\n if (\n !connectionString.startsWith('postgresql://') &&\n !connectionString.startsWith('postgres://')\n ) {\n throw new Error(\n `Invalid PostgreSQL connection string: ${connectionString}. It should start with \"postgresql://\".`,\n );\n }\n return connectionString as PostgreSQLConnectionString;\n};\n\n// Stripped from https://github.com/brianc/node-postgres\n// Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)\n// MIT License\n/**\n * Parse database name from a PostgreSQL connection string\n */\nexport function parseDatabaseName(str: string): string | null {\n // Unix socket format: /path/to/socket database_name\n if (str.charAt(0) === '/') {\n const parts = str.split(' ');\n return parts[1] || null;\n }\n\n // Encode spaces if present\n if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) {\n str = encodeURI(str).replace(/%25(\\d\\d)/g, '%$1');\n }\n\n let result: URL;\n try {\n result = new URL(str, 'postgres://base');\n } catch {\n // Try with dummy host for malformed URLs\n try {\n result = new URL(str.replace('@/', '@___DUMMY___/'), 'postgres://base');\n } catch {\n return null;\n }\n }\n\n // Socket protocol: socket://path?db=dbname\n if (result.protocol === 'socket:') {\n return result.searchParams.get('db');\n }\n\n // Standard URL: postgres://user:pass@host:port/database\n const pathname = result.pathname.slice(1) || null;\n return pathname ? decodeURI(pathname) : null;\n}\n","import { exists, SQL, type SQLExecutor } from '../../../../core';\nexport * from './schema';\n\nexport const defaultPostgreSqlDatabase = 'postgres';\n\nexport const tableExistsSQL = (tableName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT FROM pg_tables\n WHERE tablename = ${tableName}\n ) AS exists;`;\n\nexport const tableExists = async (\n execute: SQLExecutor,\n tableName: string,\n): Promise<boolean> => exists(execute.query(tableExistsSQL(tableName)));\n\nexport const functionExistsSQL = (functionName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT FROM pg_proc\n WHERE\n proname = ${functionName}\n ) AS exists;`;\n\nexport const functionExists = async (\n execute: SQLExecutor,\n functionName: string,\n): Promise<boolean> => exists(execute.query(functionExistsSQL(functionName)));\n","import type { DatabaseMetadata } from '../../../../core';\nimport { parseDatabaseName } from '../connections';\nimport {\n defaultPostgreSqlDatabase,\n functionExists,\n tableExists,\n} from './schema';\n\nexport const postgreSQLMetadata: DatabaseMetadata<true, true, true> = {\n databaseType: 'PostgreSQL',\n defaultDatabaseName: defaultPostgreSqlDatabase,\n capabilities: {\n supportsSchemas: true,\n supportsFunctions: true,\n supportsMultipleDatabases: true,\n },\n tableExists,\n functionExists,\n parseDatabaseName: (connectionString?: string) =>\n (connectionString ? parseDatabaseName(connectionString) : null) ??\n defaultPostgreSqlDatabase,\n};\n\ndumboDatabaseMetadataRegistry.register('PostgreSQL', postgreSQLMetadata);\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4MMMEDQ7cjs = require('./chunk-4MMMEDQ7.cjs');
|
|
5
5
|
|
|
6
6
|
// src/storage/sqlite/core/schema/schema.ts
|
|
7
7
|
var defaultSQLiteDatabase = ":memory:";
|
|
8
|
-
var tableExistsSQL = (tableName) =>
|
|
8
|
+
var tableExistsSQL = (tableName) => _chunk4MMMEDQ7cjs.SQL`
|
|
9
9
|
SELECT EXISTS (
|
|
10
10
|
SELECT 1
|
|
11
11
|
FROM sqlite_master
|
|
12
12
|
WHERE type = 'table' AND name = ${tableName}
|
|
13
13
|
) AS "exists"
|
|
14
14
|
`;
|
|
15
|
-
var tableExists = async (execute, tableName) =>
|
|
15
|
+
var tableExists = async (execute, tableName) => _chunk4MMMEDQ7cjs.exists.call(void 0, execute.query(tableExistsSQL(tableName)));
|
|
16
16
|
|
|
17
17
|
// src/storage/sqlite/core/schema/sqliteMetadata.ts
|
|
18
18
|
var sqliteMetadata = {
|
|
@@ -31,4 +31,4 @@ dumboDatabaseMetadataRegistry.register("SQLite", sqliteMetadata);
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
exports.defaultSQLiteDatabase = defaultSQLiteDatabase; exports.tableExists = tableExists; exports.sqliteMetadata = sqliteMetadata;
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-RQ3KKMTP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-RQ3KKMTP.cjs","../src/storage/sqlite/core/schema/schema.ts","../src/storage/sqlite/core/schema/sqliteMetadata.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACFO,IAAM,sBAAA,EAAwB,UAAA;AAErC,IAAM,eAAA,EAAiB,CAAC,SAAA,EAAA,GACtB,qBAAA,CAAA;AAAA;AAAA;AAAA;AAAA,oCAAA,EAIoC,SAAS,CAAA;AAAA;AAAA,GAAA,CAAA;AAIxC,IAAM,YAAA,EAAc,MAAA,CACzB,OAAA,EACA,SAAA,EAAA,GACqB,sCAAA,OAAO,CAAQ,KAAA,CAAM,cAAA,CAAe,SAAS,CAAC,CAAC,CAAA;ADFtE;AACA;AEbO,IAAM,eAAA,EAAwD;AAAA,EACnE,YAAA,EAAc,QAAA;AAAA,EACd,YAAA,EAAc;AAAA,IACZ,eAAA,EAAiB,KAAA;AAAA,IACjB,iBAAA,EAAmB,KAAA;AAAA,IACnB,yBAAA,EAA2B;AAAA,EAC7B,CAAA;AAAA,EACA;AACF,CAAA;AAEA,6BAAA,CAA8B,QAAA,CAAS,QAAA,EAAU,cAAc,CAAA;AFc/D;AACA;AACE;AACA;AACA;AACF,kIAAC","file":"/home/runner/work/Pongo/Pongo/src/packages/dumbo/dist/chunk-RQ3KKMTP.cjs","sourcesContent":[null,"import { exists, SQL, type SQLExecutor } from '../../../../core';\nexport * from './schema';\n\nexport const defaultSQLiteDatabase = ':memory:';\n\nconst tableExistsSQL = (tableName: string): SQL =>\n SQL`\n SELECT EXISTS (\n SELECT 1\n FROM sqlite_master\n WHERE type = 'table' AND name = ${tableName}\n ) AS \"exists\"\n `;\n\nexport const tableExists = async (\n execute: SQLExecutor,\n tableName: string,\n): Promise<boolean> => exists(execute.query(tableExistsSQL(tableName)));\n","import type { DatabaseMetadata } from '../../../../core';\nimport { tableExists } from './schema';\n\nexport const sqliteMetadata: DatabaseMetadata<false, false, false> = {\n databaseType: 'SQLite',\n capabilities: {\n supportsSchemas: false,\n supportsFunctions: false,\n supportsMultipleDatabases: false,\n },\n tableExists,\n};\n\ndumboDatabaseMetadataRegistry.register('SQLite', sqliteMetadata);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SQL,
|
|
3
3
|
exists
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H2JBS7HM.js";
|
|
5
5
|
|
|
6
6
|
// src/storage/sqlite/core/schema/schema.ts
|
|
7
7
|
var defaultSQLiteDatabase = ":memory:";
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
tableExists,
|
|
32
32
|
sqliteMetadata
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-UK7MXVS2.js.map
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
registerDefaultMigratorOptions,
|
|
29
29
|
registerFormatter,
|
|
30
30
|
single
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-H2JBS7HM.js";
|
|
32
32
|
|
|
33
33
|
// src/storage/postgresql/core/errors/errorMapper.ts
|
|
34
34
|
var getPostgresErrorCode = (error) => {
|
|
@@ -478,4 +478,4 @@ export {
|
|
|
478
478
|
pgFormatter,
|
|
479
479
|
PostgreSQLDatabaseName
|
|
480
480
|
};
|
|
481
|
-
//# sourceMappingURL=chunk-
|
|
481
|
+
//# sourceMappingURL=chunk-Y5TD53QE.js.map
|
package/dist/cloudflare.cjs
CHANGED
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkJIZGCEPEcjs = require('./chunk-JIZGCEPE.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkRQ3KKMTPcjs = require('./chunk-RQ3KKMTP.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -49,7 +49,7 @@ var _chunkHZM7GDOTcjs = require('./chunk-HZM7GDOT.cjs');
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var _chunk4MMMEDQ7cjs = require('./chunk-4MMMEDQ7.cjs');
|
|
53
53
|
|
|
54
54
|
// src/storage/sqlite/d1/connections/d1Client.ts
|
|
55
55
|
var d1Client = (options) => {
|
|
@@ -71,7 +71,7 @@ var d1Client = (options) => {
|
|
|
71
71
|
);
|
|
72
72
|
},
|
|
73
73
|
query: async (sql, _options) => {
|
|
74
|
-
const { query, params } =
|
|
74
|
+
const { query, params } = _chunkJIZGCEPEcjs.sqliteFormatter.format(sql, { serializer });
|
|
75
75
|
const stmt = execute.prepare(query);
|
|
76
76
|
const bound = _optionalChain([params, 'optionalAccess', _ => _.length]) ? stmt.bind(...params) : stmt;
|
|
77
77
|
const { results } = await bound.all();
|
|
@@ -79,7 +79,7 @@ var d1Client = (options) => {
|
|
|
79
79
|
},
|
|
80
80
|
batchQuery: async (sqls, _options) => {
|
|
81
81
|
const statements = sqls.map((sql) => {
|
|
82
|
-
const { query, params } =
|
|
82
|
+
const { query, params } = _chunkJIZGCEPEcjs.sqliteFormatter.format(sql, { serializer });
|
|
83
83
|
const stmt = execute.prepare(query);
|
|
84
84
|
return _optionalChain([params, 'optionalAccess', _3 => _3.length]) ? stmt.bind(...params) : stmt;
|
|
85
85
|
});
|
|
@@ -90,7 +90,7 @@ var d1Client = (options) => {
|
|
|
90
90
|
}));
|
|
91
91
|
},
|
|
92
92
|
command: async (sql, _options) => {
|
|
93
|
-
const { query, params } =
|
|
93
|
+
const { query, params } = _chunkJIZGCEPEcjs.sqliteFormatter.format(sql, { serializer });
|
|
94
94
|
const stmt = execute.prepare(query);
|
|
95
95
|
const bound = _optionalChain([params, 'optionalAccess', _6 => _6.length]) ? stmt.bind(...params) : stmt;
|
|
96
96
|
const result = await bound.run();
|
|
@@ -101,7 +101,7 @@ var d1Client = (options) => {
|
|
|
101
101
|
},
|
|
102
102
|
batchCommand: async (sqls, options2) => {
|
|
103
103
|
const statements = sqls.map((sql) => {
|
|
104
|
-
const { query, params } =
|
|
104
|
+
const { query, params } = _chunkJIZGCEPEcjs.sqliteFormatter.format(sql, { serializer });
|
|
105
105
|
const stmt = execute.prepare(query);
|
|
106
106
|
return _optionalChain([params, 'optionalAccess', _9 => _9.length]) ? stmt.bind(...params) : stmt;
|
|
107
107
|
});
|
|
@@ -112,7 +112,7 @@ var d1Client = (options) => {
|
|
|
112
112
|
rows: _nullishCoalesce(result.results, () => ( []))
|
|
113
113
|
};
|
|
114
114
|
if (_optionalChain([options2, 'optionalAccess', _12 => _12.assertChanges]) && (_nullishCoalesce(qr.rowCount, () => ( 0))) === 0) {
|
|
115
|
-
throw new (0,
|
|
115
|
+
throw new (0, _chunk4MMMEDQ7cjs.BatchCommandNoChangesError)(i);
|
|
116
116
|
}
|
|
117
117
|
return qr;
|
|
118
118
|
});
|
|
@@ -126,14 +126,14 @@ var asError = (error) => error instanceof Error ? error : void 0;
|
|
|
126
126
|
var mapConstraintError = (message, innerError) => {
|
|
127
127
|
const upperMessage = _nullishCoalesce(_optionalChain([message, 'optionalAccess', _13 => _13.toUpperCase, 'call', _14 => _14()]), () => ( ""));
|
|
128
128
|
if (upperMessage.includes("UNIQUE") || upperMessage.includes("PRIMARY KEY"))
|
|
129
|
-
return new (0,
|
|
129
|
+
return new (0, _chunk4MMMEDQ7cjs.UniqueConstraintError)(message, innerError);
|
|
130
130
|
if (upperMessage.includes("FOREIGN KEY"))
|
|
131
|
-
return new (0,
|
|
131
|
+
return new (0, _chunk4MMMEDQ7cjs.ForeignKeyViolationError)(message, innerError);
|
|
132
132
|
if (upperMessage.includes("NOT NULL"))
|
|
133
|
-
return new (0,
|
|
133
|
+
return new (0, _chunk4MMMEDQ7cjs.NotNullViolationError)(message, innerError);
|
|
134
134
|
if (upperMessage.includes("CHECK"))
|
|
135
|
-
return new (0,
|
|
136
|
-
return new (0,
|
|
135
|
+
return new (0, _chunk4MMMEDQ7cjs.CheckViolationError)(message, innerError);
|
|
136
|
+
return new (0, _chunk4MMMEDQ7cjs.IntegrityConstraintViolationError)(message, innerError);
|
|
137
137
|
};
|
|
138
138
|
var isConstraintMessage = (upper) => upper.includes("CONSTRAINT") || upper.includes("UNIQUE") || upper.includes("PRIMARY KEY") || upper.includes("FOREIGN KEY") || upper.includes("NOT NULL");
|
|
139
139
|
var SQLITE_CODE_RE = /SQLITE_([A-Z]+)/;
|
|
@@ -146,57 +146,57 @@ var mapEmbeddedSqliteCode = (code, message, innerError) => {
|
|
|
146
146
|
case "SQLITE_CONSTRAINT":
|
|
147
147
|
return mapConstraintError(message, innerError);
|
|
148
148
|
case "SQLITE_BUSY":
|
|
149
|
-
return new (0,
|
|
149
|
+
return new (0, _chunk4MMMEDQ7cjs.LockNotAvailableError)(message, innerError);
|
|
150
150
|
case "SQLITE_LOCKED":
|
|
151
|
-
return new (0,
|
|
151
|
+
return new (0, _chunk4MMMEDQ7cjs.DeadlockError)(message, innerError);
|
|
152
152
|
case "SQLITE_PROTOCOL":
|
|
153
|
-
return new (0,
|
|
153
|
+
return new (0, _chunk4MMMEDQ7cjs.LockNotAvailableError)(message, innerError);
|
|
154
154
|
case "SQLITE_CANTOPEN":
|
|
155
|
-
return new (0,
|
|
155
|
+
return new (0, _chunk4MMMEDQ7cjs.ConnectionError)(message, innerError);
|
|
156
156
|
case "SQLITE_NOTADB":
|
|
157
|
-
return new (0,
|
|
157
|
+
return new (0, _chunk4MMMEDQ7cjs.ConnectionError)(message, innerError);
|
|
158
158
|
case "SQLITE_NOMEM":
|
|
159
|
-
return new (0,
|
|
159
|
+
return new (0, _chunk4MMMEDQ7cjs.InsufficientResourcesError)(message, innerError);
|
|
160
160
|
case "SQLITE_FULL":
|
|
161
|
-
return new (0,
|
|
161
|
+
return new (0, _chunk4MMMEDQ7cjs.InsufficientResourcesError)(message, innerError);
|
|
162
162
|
case "SQLITE_IOERR":
|
|
163
|
-
return new (0,
|
|
163
|
+
return new (0, _chunk4MMMEDQ7cjs.SystemError)(message, innerError);
|
|
164
164
|
case "SQLITE_CORRUPT":
|
|
165
|
-
return new (0,
|
|
165
|
+
return new (0, _chunk4MMMEDQ7cjs.SystemError)(message, innerError);
|
|
166
166
|
case "SQLITE_INTERNAL":
|
|
167
|
-
return new (0,
|
|
167
|
+
return new (0, _chunk4MMMEDQ7cjs.SystemError)(message, innerError);
|
|
168
168
|
case "SQLITE_NOLFS":
|
|
169
|
-
return new (0,
|
|
169
|
+
return new (0, _chunk4MMMEDQ7cjs.SystemError)(message, innerError);
|
|
170
170
|
case "SQLITE_TOOBIG":
|
|
171
|
-
return new (0,
|
|
171
|
+
return new (0, _chunk4MMMEDQ7cjs.DataError)(message, innerError);
|
|
172
172
|
case "SQLITE_MISMATCH":
|
|
173
|
-
return new (0,
|
|
173
|
+
return new (0, _chunk4MMMEDQ7cjs.DataError)(message, innerError);
|
|
174
174
|
case "SQLITE_RANGE":
|
|
175
|
-
return new (0,
|
|
175
|
+
return new (0, _chunk4MMMEDQ7cjs.DataError)(message, innerError);
|
|
176
176
|
case "SQLITE_ERROR":
|
|
177
|
-
return new (0,
|
|
177
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
178
178
|
case "SQLITE_READONLY":
|
|
179
|
-
return new (0,
|
|
179
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
180
180
|
case "SQLITE_MISUSE":
|
|
181
|
-
return new (0,
|
|
181
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
182
182
|
case "SQLITE_AUTH":
|
|
183
|
-
return new (0,
|
|
183
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
184
184
|
case "SQLITE_PERM":
|
|
185
|
-
return new (0,
|
|
185
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
186
186
|
case "SQLITE_SCHEMA":
|
|
187
|
-
return new (0,
|
|
187
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
188
188
|
case "SQLITE_ABORT":
|
|
189
|
-
return new (0,
|
|
189
|
+
return new (0, _chunk4MMMEDQ7cjs.SerializationError)(message, innerError);
|
|
190
190
|
case "SQLITE_INTERRUPT":
|
|
191
|
-
return new (0,
|
|
191
|
+
return new (0, _chunk4MMMEDQ7cjs.SerializationError)(message, innerError);
|
|
192
192
|
}
|
|
193
193
|
return void 0;
|
|
194
194
|
};
|
|
195
195
|
var mapD1Error = (error) => {
|
|
196
|
-
if (
|
|
196
|
+
if (_chunk4MMMEDQ7cjs.DumboError.isInstanceOf(error)) return error;
|
|
197
197
|
const message = getErrorMessage(error);
|
|
198
198
|
if (!message)
|
|
199
|
-
return new (0,
|
|
199
|
+
return new (0, _chunk4MMMEDQ7cjs.DumboError)({
|
|
200
200
|
errorCode: 500,
|
|
201
201
|
message: error instanceof Error ? error.message : String(error),
|
|
202
202
|
innerError: asError(error)
|
|
@@ -204,34 +204,34 @@ var mapD1Error = (error) => {
|
|
|
204
204
|
const innerError = asError(error);
|
|
205
205
|
const upper = message.toUpperCase();
|
|
206
206
|
if (upper.startsWith("D1_TYPE_ERROR"))
|
|
207
|
-
return new (0,
|
|
207
|
+
return new (0, _chunk4MMMEDQ7cjs.DataError)(message, innerError);
|
|
208
208
|
if (upper.startsWith("D1_COLUMN_NOTFOUND"))
|
|
209
|
-
return new (0,
|
|
209
|
+
return new (0, _chunk4MMMEDQ7cjs.DataError)(message, innerError);
|
|
210
210
|
if (upper.startsWith("D1_DUMP_ERROR"))
|
|
211
|
-
return new (0,
|
|
211
|
+
return new (0, _chunk4MMMEDQ7cjs.SystemError)(message, innerError);
|
|
212
212
|
if (upper.startsWith("D1_SESSION_ERROR"))
|
|
213
|
-
return new (0,
|
|
213
|
+
return new (0, _chunk4MMMEDQ7cjs.ConnectionError)(message, innerError);
|
|
214
214
|
if (isConstraintMessage(upper)) {
|
|
215
215
|
return mapConstraintError(message, innerError);
|
|
216
216
|
}
|
|
217
217
|
if (upper.includes("NETWORK CONNECTION LOST") || upper.includes("CANNOT RESOLVE D1 DB DUE TO TRANSIENT ISSUE") || upper.includes("D1 DB RESET BECAUSE"))
|
|
218
|
-
return new (0,
|
|
218
|
+
return new (0, _chunk4MMMEDQ7cjs.ConnectionError)(message, innerError);
|
|
219
219
|
if (upper.includes("D1 DB IS OVERLOADED") || upper.includes("TOO MANY REQUESTS") || upper.includes("MEMORY LIMIT WOULD BE EXCEEDED"))
|
|
220
|
-
return new (0,
|
|
220
|
+
return new (0, _chunk4MMMEDQ7cjs.InsufficientResourcesError)(message, innerError);
|
|
221
221
|
if (upper.startsWith("D1_ERROR") || upper.startsWith("D1_EXEC_ERROR")) {
|
|
222
222
|
const embeddedCode2 = extractEmbeddedSqliteCode(message);
|
|
223
223
|
if (embeddedCode2) {
|
|
224
224
|
const mapped = mapEmbeddedSqliteCode(embeddedCode2, message, innerError);
|
|
225
225
|
if (mapped) return mapped;
|
|
226
226
|
}
|
|
227
|
-
return new (0,
|
|
227
|
+
return new (0, _chunk4MMMEDQ7cjs.InvalidOperationError)(message, innerError);
|
|
228
228
|
}
|
|
229
229
|
const embeddedCode = extractEmbeddedSqliteCode(message);
|
|
230
230
|
if (embeddedCode) {
|
|
231
231
|
const mapped = mapEmbeddedSqliteCode(embeddedCode, message, innerError);
|
|
232
232
|
if (mapped) return mapped;
|
|
233
233
|
}
|
|
234
|
-
return new (0,
|
|
234
|
+
return new (0, _chunk4MMMEDQ7cjs.DumboError)({
|
|
235
235
|
errorCode: 500,
|
|
236
236
|
message,
|
|
237
237
|
innerError
|
|
@@ -241,12 +241,12 @@ var mapD1Error = (error) => {
|
|
|
241
241
|
// src/storage/sqlite/d1/execute/d1SqlExecutor.ts
|
|
242
242
|
var d1SQLExecutor = () => ({
|
|
243
243
|
driverType: "SQLite:d1",
|
|
244
|
-
formatter:
|
|
244
|
+
formatter: _chunkJIZGCEPEcjs.sqliteFormatter,
|
|
245
245
|
query: async (client, sql, options) => {
|
|
246
246
|
try {
|
|
247
247
|
return await client.query(sql, options);
|
|
248
248
|
} catch (error) {
|
|
249
|
-
|
|
249
|
+
_chunk4MMMEDQ7cjs.tracer.error("db:sql:query:execute:error", { error });
|
|
250
250
|
throw mapD1Error(error);
|
|
251
251
|
}
|
|
252
252
|
},
|
|
@@ -254,7 +254,7 @@ var d1SQLExecutor = () => ({
|
|
|
254
254
|
try {
|
|
255
255
|
return await client.batchQuery(sqls, options);
|
|
256
256
|
} catch (error) {
|
|
257
|
-
|
|
257
|
+
_chunk4MMMEDQ7cjs.tracer.error("db:sql:batch_query:execute:error", { error });
|
|
258
258
|
throw mapD1Error(error);
|
|
259
259
|
}
|
|
260
260
|
},
|
|
@@ -262,7 +262,7 @@ var d1SQLExecutor = () => ({
|
|
|
262
262
|
try {
|
|
263
263
|
return await client.command(sql, options);
|
|
264
264
|
} catch (error) {
|
|
265
|
-
|
|
265
|
+
_chunk4MMMEDQ7cjs.tracer.error("db:sql:command:execute:error", { error });
|
|
266
266
|
throw mapD1Error(error);
|
|
267
267
|
}
|
|
268
268
|
},
|
|
@@ -270,7 +270,7 @@ var d1SQLExecutor = () => ({
|
|
|
270
270
|
try {
|
|
271
271
|
return await client.batchCommand(sqls, options);
|
|
272
272
|
} catch (error) {
|
|
273
|
-
|
|
273
|
+
_chunk4MMMEDQ7cjs.tracer.error("db:sql:batch_command:execute:error", { error });
|
|
274
274
|
throw mapD1Error(error);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
@@ -286,7 +286,7 @@ var D1TransactionNotSupportedError = class extends Error {
|
|
|
286
286
|
}
|
|
287
287
|
};
|
|
288
288
|
var d1Transaction = (connection, serializer, defaultOptions) => (getClient, options) => {
|
|
289
|
-
const transactionCounter =
|
|
289
|
+
const transactionCounter = _chunkJIZGCEPEcjs.transactionNestingCounter.call(void 0, );
|
|
290
290
|
const allowNestedTransactions = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _15 => _15.allowNestedTransactions]), () => ( _optionalChain([defaultOptions, 'optionalAccess', _16 => _16.allowNestedTransactions])));
|
|
291
291
|
const mode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _17 => _17.mode]), () => ( _optionalChain([defaultOptions, 'optionalAccess', _18 => _18.mode])));
|
|
292
292
|
let client = null;
|
|
@@ -342,7 +342,7 @@ var d1Transaction = (connection, serializer, defaultOptions) => (getClient, opti
|
|
|
342
342
|
if (_optionalChain([options, 'optionalAccess', _23 => _23.close])) await _optionalChain([options, 'optionalAccess', _24 => _24.close, 'call', _25 => _25(client2, error)]);
|
|
343
343
|
}
|
|
344
344
|
},
|
|
345
|
-
execute:
|
|
345
|
+
execute: _chunk4MMMEDQ7cjs.sqlExecutor.call(void 0, d1SQLExecutor(), {
|
|
346
346
|
connect: () => {
|
|
347
347
|
if (!sessionClient) {
|
|
348
348
|
throw new Error(
|
|
@@ -360,7 +360,7 @@ var d1Transaction = (connection, serializer, defaultOptions) => (getClient, opti
|
|
|
360
360
|
var D1DriverType = "SQLite:d1";
|
|
361
361
|
var d1Connection = (options) => {
|
|
362
362
|
const connection = _nullishCoalesce(_nullishCoalesce(options.connection, () => ( _optionalChain([options, 'access', _26 => _26.transaction, 'optionalAccess', _27 => _27.connection]))), () => ( {
|
|
363
|
-
...
|
|
363
|
+
..._chunkJIZGCEPEcjs.sqliteAmbientClientConnection.call(void 0, {
|
|
364
364
|
driverType: D1DriverType,
|
|
365
365
|
client: _nullishCoalesce(options.client, () => ( d1Client(options))),
|
|
366
366
|
initTransaction: (connection2) => d1Transaction(
|
|
@@ -392,11 +392,11 @@ var d1Connection = (options) => {
|
|
|
392
392
|
};
|
|
393
393
|
|
|
394
394
|
// src/storage/sqlite/d1/pool/d1ConnectionPool.ts
|
|
395
|
-
var d1Pool = (options) =>
|
|
395
|
+
var d1Pool = (options) => _chunk4MMMEDQ7cjs.createSingletonConnectionPool.call(void 0, {
|
|
396
396
|
driverType: D1DriverType,
|
|
397
397
|
getConnection: () => d1Connection({
|
|
398
398
|
...options,
|
|
399
|
-
serializer:
|
|
399
|
+
serializer: _chunk4MMMEDQ7cjs.JSONSerializer.from(options)
|
|
400
400
|
})
|
|
401
401
|
});
|
|
402
402
|
|
|
@@ -404,15 +404,15 @@ var d1Pool = (options) => _chunkGVR3PSDLcjs.createSingletonConnectionPool.call(v
|
|
|
404
404
|
var d1DumboDriver = {
|
|
405
405
|
driverType: D1DriverType,
|
|
406
406
|
createPool: (options) => d1Pool(options),
|
|
407
|
-
sqlFormatter:
|
|
408
|
-
defaultMigratorOptions:
|
|
407
|
+
sqlFormatter: _chunkJIZGCEPEcjs.sqliteFormatter,
|
|
408
|
+
defaultMigratorOptions: _chunkJIZGCEPEcjs.DefaultSQLiteMigratorOptions,
|
|
409
409
|
canHandle: (options) => {
|
|
410
410
|
return options.driverType === D1DriverType && "database" in options;
|
|
411
411
|
},
|
|
412
|
-
databaseMetadata:
|
|
412
|
+
databaseMetadata: _chunkRQ3KKMTPcjs.sqliteMetadata
|
|
413
413
|
};
|
|
414
414
|
var useD1DumboDriver = () => {
|
|
415
|
-
|
|
415
|
+
_chunk4MMMEDQ7cjs.dumboDatabaseDriverRegistry.register(D1DriverType, d1DumboDriver);
|
|
416
416
|
};
|
|
417
417
|
useD1DumboDriver();
|
|
418
418
|
|
|
@@ -452,5 +452,5 @@ useD1DumboDriver();
|
|
|
452
452
|
|
|
453
453
|
|
|
454
454
|
|
|
455
|
-
exports.D1DriverType = D1DriverType; exports.D1TransactionNotSupportedError = D1TransactionNotSupportedError; exports.DEFAULT_SQLITE_PRAGMA_OPTIONS =
|
|
455
|
+
exports.D1DriverType = D1DriverType; exports.D1TransactionNotSupportedError = D1TransactionNotSupportedError; exports.DEFAULT_SQLITE_PRAGMA_OPTIONS = _chunkJIZGCEPEcjs.DEFAULT_SQLITE_PRAGMA_OPTIONS; exports.DefaultSQLiteMigratorOptions = _chunkJIZGCEPEcjs.DefaultSQLiteMigratorOptions; exports.InMemorySQLiteDatabase = _chunkJIZGCEPEcjs.InMemorySQLiteDatabase; exports.SQLiteConnectionString = _chunkJIZGCEPEcjs.SQLiteConnectionString; exports.SQLiteDatabaseName = _chunkJIZGCEPEcjs.SQLiteDatabaseName; exports.d1Client = d1Client; exports.d1Connection = d1Connection; exports.d1DumboDriver = d1DumboDriver; exports.d1Pool = d1Pool; exports.d1SQLExecutor = d1SQLExecutor; exports.d1Transaction = d1Transaction; exports.defaultSQLiteDatabase = _chunkRQ3KKMTPcjs.defaultSQLiteDatabase; exports.isInMemoryDatabase = _chunkJIZGCEPEcjs.isInMemoryDatabase; exports.isSQLiteError = _chunkJIZGCEPEcjs.isSQLiteError; exports.mapD1Error = mapD1Error; exports.mapSqliteError = _chunkJIZGCEPEcjs.mapSqliteError; exports.parsePragmasFromConnectionString = _chunkJIZGCEPEcjs.parsePragmasFromConnectionString; exports.sqliteAlwaysNewConnectionPool = _chunkJIZGCEPEcjs.sqliteAlwaysNewConnectionPool; exports.sqliteAmbientClientConnection = _chunkJIZGCEPEcjs.sqliteAmbientClientConnection; exports.sqliteAmbientConnectionPool = _chunkJIZGCEPEcjs.sqliteAmbientConnectionPool; exports.sqliteClientConnection = _chunkJIZGCEPEcjs.sqliteClientConnection; exports.sqliteConnection = _chunkJIZGCEPEcjs.sqliteConnection; exports.sqliteExecute = _chunkJIZGCEPEcjs.sqliteExecute; exports.sqliteFormatter = _chunkJIZGCEPEcjs.sqliteFormatter; exports.sqliteMetadata = _chunkRQ3KKMTPcjs.sqliteMetadata; exports.sqlitePool = _chunkJIZGCEPEcjs.sqlitePool; exports.sqlitePoolClientConnection = _chunkJIZGCEPEcjs.sqlitePoolClientConnection; exports.sqliteSQLExecutor = _chunkJIZGCEPEcjs.sqliteSQLExecutor; exports.sqliteSingletonConnectionPool = _chunkJIZGCEPEcjs.sqliteSingletonConnectionPool; exports.sqliteTransaction = _chunkJIZGCEPEcjs.sqliteTransaction; exports.tableExists = _chunkRQ3KKMTPcjs.tableExists; exports.toSqlitePoolOptions = _chunkJIZGCEPEcjs.toSqlitePoolOptions; exports.transactionNestingCounter = _chunkJIZGCEPEcjs.transactionNestingCounter; exports.useD1DumboDriver = useD1DumboDriver;
|
|
456
456
|
//# sourceMappingURL=cloudflare.cjs.map
|