@event-driven-io/dumbo 0.13.0-beta.41 → 0.13.0-beta.43
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/cloudflare.cjs +2193 -85
- package/dist/cloudflare.cjs.map +1 -1
- package/dist/cloudflare.d.cts +1106 -3
- package/dist/cloudflare.d.ts +1106 -3
- package/dist/cloudflare.js +2083 -4
- package/dist/cloudflare.js.map +1 -1
- package/dist/index.cjs +2522 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1676 -3
- package/dist/index.d.ts +1676 -3
- package/dist/index.js +2337 -9
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +2051 -57
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +1041 -3
- package/dist/pg.d.ts +1041 -3
- package/dist/pg.js +1969 -4
- package/dist/pg.js.map +1 -1
- package/dist/postgresql.cjs +1845 -24
- package/dist/postgresql.cjs.map +1 -0
- package/dist/postgresql.d.cts +1034 -3
- package/dist/postgresql.d.ts +1034 -3
- package/dist/postgresql.js +1795 -3
- package/dist/postgresql.js.map +1 -0
- package/dist/sqlite.cjs +2124 -29
- package/dist/sqlite.cjs.map +1 -0
- package/dist/sqlite.d.cts +1107 -3
- package/dist/sqlite.d.ts +1107 -3
- package/dist/sqlite.js +2069 -3
- package/dist/sqlite.js.map +1 -0
- package/dist/sqlite3.cjs +2412 -60
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +1106 -4
- package/dist/sqlite3.d.ts +1106 -4
- package/dist/sqlite3.js +2327 -4
- package/dist/sqlite3.js.map +1 -1
- package/package.json +1 -1
- package/dist/core-BMeDuqBQ.js +0 -2265
- package/dist/core-BMeDuqBQ.js.map +0 -1
- package/dist/core-BPNgo5b6.js +0 -379
- package/dist/core-BPNgo5b6.js.map +0 -1
- package/dist/core-CIVu4cNp.cjs +0 -588
- package/dist/core-CIVu4cNp.cjs.map +0 -1
- package/dist/core-D5W_5J8k.cjs +0 -3246
- package/dist/core-D5W_5J8k.cjs.map +0 -1
- package/dist/core-DqUjje4u.cjs +0 -450
- package/dist/core-DqUjje4u.cjs.map +0 -1
- package/dist/core-gu5fi784.js +0 -451
- package/dist/core-gu5fi784.js.map +0 -1
- package/dist/index-B-q2er0S.d.cts +0 -186
- package/dist/index-B5qbt5nP.d.ts +0 -186
- package/dist/index-BJJAkyuJ.d.ts +0 -68
- package/dist/index-CRbkvVjT.d.ts +0 -1587
- package/dist/index-Cmdlb0KP.d.cts +0 -1587
- package/dist/index-D7qxqMf9.d.cts +0 -67
- package/dist/index-DtRCGhFP.d.cts +0 -68
- package/dist/index-m5LDyNNF.d.ts +0 -67
- package/dist/postgreSQLMetadata-Khf1e9CT.js +0 -65
- package/dist/postgreSQLMetadata-Khf1e9CT.js.map +0 -1
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs +0 -118
- package/dist/postgreSQLMetadata-Ri_p5u6i.cjs.map +0 -1
- package/dist/sqliteMetadata-CpmoZxqb.cjs +0 -46
- package/dist/sqliteMetadata-CpmoZxqb.cjs.map +0 -1
- package/dist/sqliteMetadata-viYmVwA5.js +0 -29
- package/dist/sqliteMetadata-viYmVwA5.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { La as AnySQLToken, ci as AnyTypeValidationError, cn as QueryResult, li as TypeValidationSuccess, ln as QueryResultRow } from "./index-Cmdlb0KP.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/core/sql/valueMappers/reservedSqlWords.d.ts
|
|
4
|
-
declare const ansiSqlReservedMap: {
|
|
5
|
-
[key: string]: boolean;
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/core/sql/tokenizedSQL/tokenizedSQL.d.ts
|
|
9
|
-
type TokenizedSQL = Readonly<{
|
|
10
|
-
__brand: 'tokenized-sql';
|
|
11
|
-
sqlChunks: ReadonlyArray<string>;
|
|
12
|
-
sqlTokens: ReadonlyArray<AnySQLToken>;
|
|
13
|
-
}>;
|
|
14
|
-
declare const TokenizedSQL: {
|
|
15
|
-
(strings: ReadonlyArray<string>, values: unknown[]): TokenizedSQL;
|
|
16
|
-
paramPlaceholder: string;
|
|
17
|
-
empty: {
|
|
18
|
-
__brand: "tokenized-sql";
|
|
19
|
-
sqlChunks: string[];
|
|
20
|
-
sqlTokens: never[];
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
declare const isTokenizedSQL: (value: unknown) => value is TokenizedSQL;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/core/query/mappers.d.ts
|
|
26
|
-
declare const mapRows: <Result extends QueryResultRow = QueryResultRow, Mapped = unknown>(getResult: Promise<QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
|
|
27
|
-
declare const toCamelCase: (snakeStr: string) => string;
|
|
28
|
-
declare const mapToCamelCase: <T extends Record<string, unknown>>(obj: Record<string, unknown>) => T;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/core/query/selectors.d.ts
|
|
31
|
-
declare const firstOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
|
|
32
|
-
declare const first: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
|
|
33
|
-
declare const singleOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
|
|
34
|
-
declare const single: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
|
|
35
|
-
type CountSQLQueryResult = {
|
|
36
|
-
count: number;
|
|
37
|
-
};
|
|
38
|
-
declare const count: (getResult: Promise<QueryResult<CountSQLQueryResult>>) => Promise<number>;
|
|
39
|
-
type ExistsSQLQueryResult = {
|
|
40
|
-
exists: boolean | 1 | 0;
|
|
41
|
-
};
|
|
42
|
-
declare const exists: (getResult: Promise<QueryResult<ExistsSQLQueryResult>>) => Promise<boolean>;
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/core/testing/typesTesting.d.ts
|
|
45
|
-
type Expect<T extends true> = T;
|
|
46
|
-
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
|
|
47
|
-
type IsError<T> = T extends AnyTypeValidationError ? true : false;
|
|
48
|
-
type IsOK<T> = T extends TypeValidationSuccess ? true : false;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/core/tracing/printing/color.d.ts
|
|
51
|
-
declare const color: {
|
|
52
|
-
level: 0 | 1;
|
|
53
|
-
hex: (value: string) => (text: string) => string;
|
|
54
|
-
red: (value: string) => string;
|
|
55
|
-
green: (value: string) => string;
|
|
56
|
-
blue: (value: string) => string;
|
|
57
|
-
cyan: (value: string) => string;
|
|
58
|
-
yellow: (value: string) => string;
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/core/tracing/printing/pretty.d.ts
|
|
62
|
-
declare const prettyJson: (obj: unknown, options?: {
|
|
63
|
-
handleMultiline?: boolean;
|
|
64
|
-
}) => string;
|
|
65
|
-
//#endregion
|
|
66
|
-
export { toCamelCase as _, IsError as a, ansiSqlReservedMap as b, ExistsSQLQueryResult as c, first as d, firstOrNull as f, mapToCamelCase as g, mapRows as h, Expect as i, count as l, singleOrNull as m, color as n, IsOK as o, single as p, Equals as r, CountSQLQueryResult as s, prettyJson as t, exists as u, TokenizedSQL as v, isTokenizedSQL as y };
|
|
67
|
-
//# sourceMappingURL=index-D7qxqMf9.d.cts.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { At as DatabaseLockOptions, Dt as AcquireDatabaseLockMode, Gi as SQL, Jt as SQLExecutor, Mt as ReleaseDatabaseLockOptions, Ot as AcquireDatabaseLockOptions, Qi as DefaultSQLColumnProcessors, Ri as SQLFormatter, Wa as SQLIn, gn as DumboError, i as DatabaseConnectionString, kt as DatabaseLock, ra as SQLProcessor, rt as DatabaseDriverType, xt as MigratorOptions, za as SQLArray } from "./index-Cmdlb0KP.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/storage/postgresql/core/connections/connectionString.d.ts
|
|
4
|
-
declare const defaultPostgreSQLConnectionString: PostgreSQLConnectionString;
|
|
5
|
-
type PostgreSQLConnectionString = DatabaseConnectionString<'PostgreSQL', `postgresql://${string}` | `postgres://${string}`>;
|
|
6
|
-
declare const PostgreSQLConnectionString: (connectionString: string) => PostgreSQLConnectionString;
|
|
7
|
-
/**
|
|
8
|
-
* Parse database name from a PostgreSQL connection string
|
|
9
|
-
*/
|
|
10
|
-
declare function parseDatabaseName(str: string): string | null;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/storage/postgresql/core/errors/errorMapper.d.ts
|
|
13
|
-
/**
|
|
14
|
-
* Maps a PostgreSQL error (from the `pg` driver) to a typed DumboError
|
|
15
|
-
* based on the SQLSTATE code.
|
|
16
|
-
*
|
|
17
|
-
* SQLSTATE reference: https://www.postgresql.org/docs/current/errcodes-appendix.html
|
|
18
|
-
* Transient classification based on Npgsql's PostgresException.IsTransient.
|
|
19
|
-
*
|
|
20
|
-
* Falls back to a generic DumboError (500) if the error is not a recognized PostgreSQL error.
|
|
21
|
-
*/
|
|
22
|
-
declare const mapPostgresError: (error: unknown) => DumboError;
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/storage/postgresql/core/locks/advisoryLocks.d.ts
|
|
25
|
-
declare const tryAcquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<boolean>;
|
|
26
|
-
declare const releaseAdvisoryLock: (execute: SQLExecutor, options: ReleaseDatabaseLockOptions) => Promise<boolean>;
|
|
27
|
-
declare const acquireAdvisoryLock: (execute: SQLExecutor, options: AcquireDatabaseLockOptions) => Promise<void>;
|
|
28
|
-
declare const AdvisoryLock: DatabaseLock;
|
|
29
|
-
declare const advisoryLock: (execute: SQLExecutor, options: DatabaseLockOptions) => {
|
|
30
|
-
acquire: (acquireOptions?: {
|
|
31
|
-
mode: AcquireDatabaseLockMode;
|
|
32
|
-
}) => Promise<void>;
|
|
33
|
-
tryAcquire: (acquireOptions?: {
|
|
34
|
-
mode: AcquireDatabaseLockMode;
|
|
35
|
-
}) => Promise<boolean>;
|
|
36
|
-
release: () => Promise<boolean>;
|
|
37
|
-
withAcquire: <Result>(handle: () => Promise<Result>, acquireOptions?: {
|
|
38
|
-
mode: AcquireDatabaseLockMode;
|
|
39
|
-
}) => Promise<Result>;
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/storage/postgresql/core/schema/migrations.d.ts
|
|
43
|
-
declare const DefaultPostgreSQLMigratorOptions: MigratorOptions;
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/storage/postgresql/core/schema/schema.d.ts
|
|
46
|
-
declare const defaultPostgreSqlDatabase = "postgres";
|
|
47
|
-
declare const tableExistsSQL: (tableName: string) => SQL;
|
|
48
|
-
declare const tableExists: (execute: SQLExecutor, tableName: string) => Promise<boolean>;
|
|
49
|
-
declare const functionExistsSQL: (functionName: string) => SQL;
|
|
50
|
-
declare const functionExists: (execute: SQLExecutor, functionName: string) => Promise<boolean>;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/storage/postgresql/core/sql/formatter/index.d.ts
|
|
53
|
-
declare const pgFormatter: SQLFormatter;
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/storage/postgresql/core/sql/processors/arrayProcessors.d.ts
|
|
56
|
-
declare const PostgreSQLArrayProcessor: SQLProcessor<SQLArray>;
|
|
57
|
-
declare const PostgreSQLExpandSQLInProcessor: SQLProcessor<SQLIn>;
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/storage/postgresql/core/sql/processors/columProcessors.d.ts
|
|
60
|
-
declare const postgreSQLColumnProcessors: DefaultSQLColumnProcessors;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/storage/postgresql/core/index.d.ts
|
|
63
|
-
type PostgreSQLDatabaseName = 'PostgreSQL';
|
|
64
|
-
declare const PostgreSQLDatabaseName = "PostgreSQL";
|
|
65
|
-
type PostgreSQLDriverType<DriverName extends string = string> = DatabaseDriverType<PostgreSQLDatabaseName, DriverName>;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { tryAcquireAdvisoryLock as _, PostgreSQLExpandSQLInProcessor as a, defaultPostgreSQLConnectionString as b, functionExists as c, tableExistsSQL as d, DefaultPostgreSQLMigratorOptions as f, releaseAdvisoryLock as g, advisoryLock as h, PostgreSQLArrayProcessor as i, functionExistsSQL as l, acquireAdvisoryLock as m, PostgreSQLDriverType as n, pgFormatter as o, AdvisoryLock as p, postgreSQLColumnProcessors as r, defaultPostgreSqlDatabase as s, PostgreSQLDatabaseName as t, tableExists as u, mapPostgresError as v, parseDatabaseName as x, PostgreSQLConnectionString as y };
|
|
68
|
-
//# sourceMappingURL=index-DtRCGhFP.d.cts.map
|
package/dist/index-m5LDyNNF.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { La as AnySQLToken, ci as AnyTypeValidationError, cn as QueryResult, li as TypeValidationSuccess, ln as QueryResultRow } from "./index-CRbkvVjT.js";
|
|
2
|
-
|
|
3
|
-
//#region src/core/sql/valueMappers/reservedSqlWords.d.ts
|
|
4
|
-
declare const ansiSqlReservedMap: {
|
|
5
|
-
[key: string]: boolean;
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/core/sql/tokenizedSQL/tokenizedSQL.d.ts
|
|
9
|
-
type TokenizedSQL = Readonly<{
|
|
10
|
-
__brand: 'tokenized-sql';
|
|
11
|
-
sqlChunks: ReadonlyArray<string>;
|
|
12
|
-
sqlTokens: ReadonlyArray<AnySQLToken>;
|
|
13
|
-
}>;
|
|
14
|
-
declare const TokenizedSQL: {
|
|
15
|
-
(strings: ReadonlyArray<string>, values: unknown[]): TokenizedSQL;
|
|
16
|
-
paramPlaceholder: string;
|
|
17
|
-
empty: {
|
|
18
|
-
__brand: "tokenized-sql";
|
|
19
|
-
sqlChunks: string[];
|
|
20
|
-
sqlTokens: never[];
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
declare const isTokenizedSQL: (value: unknown) => value is TokenizedSQL;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/core/query/mappers.d.ts
|
|
26
|
-
declare const mapRows: <Result extends QueryResultRow = QueryResultRow, Mapped = unknown>(getResult: Promise<QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
|
|
27
|
-
declare const toCamelCase: (snakeStr: string) => string;
|
|
28
|
-
declare const mapToCamelCase: <T extends Record<string, unknown>>(obj: Record<string, unknown>) => T;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/core/query/selectors.d.ts
|
|
31
|
-
declare const firstOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
|
|
32
|
-
declare const first: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
|
|
33
|
-
declare const singleOrNull: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result | null>;
|
|
34
|
-
declare const single: <Result extends QueryResultRow = QueryResultRow>(getResult: Promise<QueryResult<Result>>) => Promise<Result>;
|
|
35
|
-
type CountSQLQueryResult = {
|
|
36
|
-
count: number;
|
|
37
|
-
};
|
|
38
|
-
declare const count: (getResult: Promise<QueryResult<CountSQLQueryResult>>) => Promise<number>;
|
|
39
|
-
type ExistsSQLQueryResult = {
|
|
40
|
-
exists: boolean | 1 | 0;
|
|
41
|
-
};
|
|
42
|
-
declare const exists: (getResult: Promise<QueryResult<ExistsSQLQueryResult>>) => Promise<boolean>;
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/core/testing/typesTesting.d.ts
|
|
45
|
-
type Expect<T extends true> = T;
|
|
46
|
-
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
|
|
47
|
-
type IsError<T> = T extends AnyTypeValidationError ? true : false;
|
|
48
|
-
type IsOK<T> = T extends TypeValidationSuccess ? true : false;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/core/tracing/printing/color.d.ts
|
|
51
|
-
declare const color: {
|
|
52
|
-
level: 0 | 1;
|
|
53
|
-
hex: (value: string) => (text: string) => string;
|
|
54
|
-
red: (value: string) => string;
|
|
55
|
-
green: (value: string) => string;
|
|
56
|
-
blue: (value: string) => string;
|
|
57
|
-
cyan: (value: string) => string;
|
|
58
|
-
yellow: (value: string) => string;
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/core/tracing/printing/pretty.d.ts
|
|
62
|
-
declare const prettyJson: (obj: unknown, options?: {
|
|
63
|
-
handleMultiline?: boolean;
|
|
64
|
-
}) => string;
|
|
65
|
-
//#endregion
|
|
66
|
-
export { toCamelCase as _, IsError as a, ansiSqlReservedMap as b, ExistsSQLQueryResult as c, first as d, firstOrNull as f, mapToCamelCase as g, mapRows as h, Expect as i, count as l, singleOrNull as m, color as n, IsOK as o, single as p, Equals as r, CountSQLQueryResult as s, prettyJson as t, exists as u, TokenizedSQL as v, isTokenizedSQL as y };
|
|
67
|
-
//# sourceMappingURL=index-m5LDyNNF.d.ts.map
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ln as exists, xt as SQL } from "./core-BMeDuqBQ.js";
|
|
2
|
-
|
|
3
|
-
//#region src/storage/postgresql/core/connections/connectionString.ts
|
|
4
|
-
const defaultPostgreSQLConnectionString = "postgresql://postgres@localhost:5432/postgres";
|
|
5
|
-
const PostgreSQLConnectionString = (connectionString) => {
|
|
6
|
-
if (!connectionString.startsWith("postgresql://") && !connectionString.startsWith("postgres://")) throw new Error(`Invalid PostgreSQL connection string: ${connectionString}. It should start with "postgresql://".`);
|
|
7
|
-
return connectionString;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Parse database name from a PostgreSQL connection string
|
|
11
|
-
*/
|
|
12
|
-
function parseDatabaseName(str) {
|
|
13
|
-
if (str.charAt(0) === "/") return str.split(" ")[1] || null;
|
|
14
|
-
if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) str = encodeURI(str).replace(/%25(\d\d)/g, "%$1");
|
|
15
|
-
let result;
|
|
16
|
-
try {
|
|
17
|
-
result = new URL(str, "postgres://base");
|
|
18
|
-
} catch {
|
|
19
|
-
try {
|
|
20
|
-
result = new URL(str.replace("@/", "@___DUMMY___/"), "postgres://base");
|
|
21
|
-
} catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (result.protocol === "socket:") return result.searchParams.get("db");
|
|
26
|
-
const pathname = result.pathname.slice(1) || null;
|
|
27
|
-
return pathname ? decodeURI(pathname) : null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/storage/postgresql/core/schema/schema.ts
|
|
32
|
-
const defaultPostgreSqlDatabase = "postgres";
|
|
33
|
-
const tableExistsSQL = (tableName) => SQL`
|
|
34
|
-
SELECT EXISTS (
|
|
35
|
-
SELECT FROM pg_tables
|
|
36
|
-
WHERE tablename = ${tableName}
|
|
37
|
-
) AS exists;`;
|
|
38
|
-
const tableExists = async (execute, tableName) => exists(execute.query(tableExistsSQL(tableName)));
|
|
39
|
-
const functionExistsSQL = (functionName) => SQL`
|
|
40
|
-
SELECT EXISTS (
|
|
41
|
-
SELECT FROM pg_proc
|
|
42
|
-
WHERE
|
|
43
|
-
proname = ${functionName}
|
|
44
|
-
) AS exists;`;
|
|
45
|
-
const functionExists = async (execute, functionName) => exists(execute.query(functionExistsSQL(functionName)));
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/storage/postgresql/core/schema/postgreSQLMetadata.ts
|
|
49
|
-
const postgreSQLMetadata = {
|
|
50
|
-
databaseType: "PostgreSQL",
|
|
51
|
-
defaultDatabaseName: defaultPostgreSqlDatabase,
|
|
52
|
-
capabilities: {
|
|
53
|
-
supportsSchemas: true,
|
|
54
|
-
supportsFunctions: true,
|
|
55
|
-
supportsMultipleDatabases: true
|
|
56
|
-
},
|
|
57
|
-
tableExists,
|
|
58
|
-
functionExists,
|
|
59
|
-
parseDatabaseName: (connectionString) => (connectionString ? parseDatabaseName(connectionString) : null) ?? "postgres"
|
|
60
|
-
};
|
|
61
|
-
dumboDatabaseMetadataRegistry.register("PostgreSQL", postgreSQLMetadata);
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
export { tableExists as a, defaultPostgreSQLConnectionString as c, functionExistsSQL as i, parseDatabaseName as l, defaultPostgreSqlDatabase as n, tableExistsSQL as o, functionExists as r, PostgreSQLConnectionString as s, postgreSQLMetadata as t };
|
|
65
|
-
//# sourceMappingURL=postgreSQLMetadata-Khf1e9CT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postgreSQLMetadata-Khf1e9CT.js","names":[],"sources":["../src/storage/postgresql/core/connections/connectionString.ts","../src/storage/postgresql/core/schema/schema.ts","../src/storage/postgresql/core/schema/postgreSQLMetadata.ts"],"sourcesContent":["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"],"mappings":";;;AAEA,MAAa,oCACX;AAOF,MAAa,8BACX,qBAC+B;AAC/B,KACE,CAAC,iBAAiB,WAAW,gBAAgB,IAC7C,CAAC,iBAAiB,WAAW,cAAc,CAE3C,OAAM,IAAI,MACR,yCAAyC,iBAAiB,yCAC3D;AAEH,QAAO;;;;;AAST,SAAgB,kBAAkB,KAA4B;AAE5D,KAAI,IAAI,OAAO,EAAE,KAAK,IAEpB,QADc,IAAI,MAAM,IACZ,CAAC,MAAM;AAIrB,KAAI,mCAAmC,KAAK,IAAI,CAC9C,OAAM,UAAU,IAAI,CAAC,QAAQ,cAAc,MAAM;CAGnD,IAAI;AACJ,KAAI;AACF,WAAS,IAAI,IAAI,KAAK,kBAAkB;SAClC;AAEN,MAAI;AACF,YAAS,IAAI,IAAI,IAAI,QAAQ,MAAM,gBAAgB,EAAE,kBAAkB;UACjE;AACN,UAAO;;;AAKX,KAAI,OAAO,aAAa,UACtB,QAAO,OAAO,aAAa,IAAI,KAAK;CAItC,MAAM,WAAW,OAAO,SAAS,MAAM,EAAE,IAAI;AAC7C,QAAO,WAAW,UAAU,SAAS,GAAG;;;;;AC1D1C,MAAa,4BAA4B;AAEzC,MAAa,kBAAkB,cAC7B,GAAG;;;wBAGmB,UAAU;;AAGlC,MAAa,cAAc,OACzB,SACA,cACqB,OAAO,QAAQ,MAAM,eAAe,UAAU,CAAC,CAAC;AAEvE,MAAa,qBAAqB,iBAChC,GAAG;;;;oBAIe,aAAa;;AAGjC,MAAa,iBAAiB,OAC5B,SACA,iBACqB,OAAO,QAAQ,MAAM,kBAAkB,aAAa,CAAC,CAAC;;;;ACpB7E,MAAa,qBAAyD;CACpE,cAAc;CACd,qBAAqB;CACrB,cAAc;EACZ,iBAAiB;EACjB,mBAAmB;EACnB,2BAA2B;EAC5B;CACD;CACA;CACA,oBAAoB,sBACjB,mBAAmB,kBAAkB,iBAAiB,GAAG;CAE7D;AAED,8BAA8B,SAAS,cAAc,mBAAmB"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
const require_core = require('./core-D5W_5J8k.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/storage/postgresql/core/connections/connectionString.ts
|
|
4
|
-
const defaultPostgreSQLConnectionString = "postgresql://postgres@localhost:5432/postgres";
|
|
5
|
-
const PostgreSQLConnectionString = (connectionString) => {
|
|
6
|
-
if (!connectionString.startsWith("postgresql://") && !connectionString.startsWith("postgres://")) throw new Error(`Invalid PostgreSQL connection string: ${connectionString}. It should start with "postgresql://".`);
|
|
7
|
-
return connectionString;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Parse database name from a PostgreSQL connection string
|
|
11
|
-
*/
|
|
12
|
-
function parseDatabaseName(str) {
|
|
13
|
-
if (str.charAt(0) === "/") return str.split(" ")[1] || null;
|
|
14
|
-
if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) str = encodeURI(str).replace(/%25(\d\d)/g, "%$1");
|
|
15
|
-
let result;
|
|
16
|
-
try {
|
|
17
|
-
result = new URL(str, "postgres://base");
|
|
18
|
-
} catch {
|
|
19
|
-
try {
|
|
20
|
-
result = new URL(str.replace("@/", "@___DUMMY___/"), "postgres://base");
|
|
21
|
-
} catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (result.protocol === "socket:") return result.searchParams.get("db");
|
|
26
|
-
const pathname = result.pathname.slice(1) || null;
|
|
27
|
-
return pathname ? decodeURI(pathname) : null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/storage/postgresql/core/schema/schema.ts
|
|
32
|
-
const defaultPostgreSqlDatabase = "postgres";
|
|
33
|
-
const tableExistsSQL = (tableName) => require_core.SQL`
|
|
34
|
-
SELECT EXISTS (
|
|
35
|
-
SELECT FROM pg_tables
|
|
36
|
-
WHERE tablename = ${tableName}
|
|
37
|
-
) AS exists;`;
|
|
38
|
-
const tableExists = async (execute, tableName) => require_core.exists(execute.query(tableExistsSQL(tableName)));
|
|
39
|
-
const functionExistsSQL = (functionName) => require_core.SQL`
|
|
40
|
-
SELECT EXISTS (
|
|
41
|
-
SELECT FROM pg_proc
|
|
42
|
-
WHERE
|
|
43
|
-
proname = ${functionName}
|
|
44
|
-
) AS exists;`;
|
|
45
|
-
const functionExists = async (execute, functionName) => require_core.exists(execute.query(functionExistsSQL(functionName)));
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/storage/postgresql/core/schema/postgreSQLMetadata.ts
|
|
49
|
-
const postgreSQLMetadata = {
|
|
50
|
-
databaseType: "PostgreSQL",
|
|
51
|
-
defaultDatabaseName: defaultPostgreSqlDatabase,
|
|
52
|
-
capabilities: {
|
|
53
|
-
supportsSchemas: true,
|
|
54
|
-
supportsFunctions: true,
|
|
55
|
-
supportsMultipleDatabases: true
|
|
56
|
-
},
|
|
57
|
-
tableExists,
|
|
58
|
-
functionExists,
|
|
59
|
-
parseDatabaseName: (connectionString) => (connectionString ? parseDatabaseName(connectionString) : null) ?? "postgres"
|
|
60
|
-
};
|
|
61
|
-
dumboDatabaseMetadataRegistry.register("PostgreSQL", postgreSQLMetadata);
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
Object.defineProperty(exports, 'PostgreSQLConnectionString', {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () {
|
|
67
|
-
return PostgreSQLConnectionString;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, 'defaultPostgreSQLConnectionString', {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
get: function () {
|
|
73
|
-
return defaultPostgreSQLConnectionString;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(exports, 'defaultPostgreSqlDatabase', {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return defaultPostgreSqlDatabase;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
Object.defineProperty(exports, 'functionExists', {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function () {
|
|
85
|
-
return functionExists;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
Object.defineProperty(exports, 'functionExistsSQL', {
|
|
89
|
-
enumerable: true,
|
|
90
|
-
get: function () {
|
|
91
|
-
return functionExistsSQL;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
Object.defineProperty(exports, 'parseDatabaseName', {
|
|
95
|
-
enumerable: true,
|
|
96
|
-
get: function () {
|
|
97
|
-
return parseDatabaseName;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(exports, 'postgreSQLMetadata', {
|
|
101
|
-
enumerable: true,
|
|
102
|
-
get: function () {
|
|
103
|
-
return postgreSQLMetadata;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
Object.defineProperty(exports, 'tableExists', {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function () {
|
|
109
|
-
return tableExists;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(exports, 'tableExistsSQL', {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function () {
|
|
115
|
-
return tableExistsSQL;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
//# sourceMappingURL=postgreSQLMetadata-Ri_p5u6i.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postgreSQLMetadata-Ri_p5u6i.cjs","names":["exists"],"sources":["../src/storage/postgresql/core/connections/connectionString.ts","../src/storage/postgresql/core/schema/schema.ts","../src/storage/postgresql/core/schema/postgreSQLMetadata.ts"],"sourcesContent":["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"],"mappings":";;;AAEA,MAAa,oCACX;AAOF,MAAa,8BACX,qBAC+B;AAC/B,KACE,CAAC,iBAAiB,WAAW,gBAAgB,IAC7C,CAAC,iBAAiB,WAAW,cAAc,CAE3C,OAAM,IAAI,MACR,yCAAyC,iBAAiB,yCAC3D;AAEH,QAAO;;;;;AAST,SAAgB,kBAAkB,KAA4B;AAE5D,KAAI,IAAI,OAAO,EAAE,KAAK,IAEpB,QADc,IAAI,MAAM,IACZ,CAAC,MAAM;AAIrB,KAAI,mCAAmC,KAAK,IAAI,CAC9C,OAAM,UAAU,IAAI,CAAC,QAAQ,cAAc,MAAM;CAGnD,IAAI;AACJ,KAAI;AACF,WAAS,IAAI,IAAI,KAAK,kBAAkB;SAClC;AAEN,MAAI;AACF,YAAS,IAAI,IAAI,IAAI,QAAQ,MAAM,gBAAgB,EAAE,kBAAkB;UACjE;AACN,UAAO;;;AAKX,KAAI,OAAO,aAAa,UACtB,QAAO,OAAO,aAAa,IAAI,KAAK;CAItC,MAAM,WAAW,OAAO,SAAS,MAAM,EAAE,IAAI;AAC7C,QAAO,WAAW,UAAU,SAAS,GAAG;;;;;AC1D1C,MAAa,4BAA4B;AAEzC,MAAa,kBAAkB,cAC7B,gBAAG;;;wBAGmB,UAAU;;AAGlC,MAAa,cAAc,OACzB,SACA,cACqBA,oBAAO,QAAQ,MAAM,eAAe,UAAU,CAAC,CAAC;AAEvE,MAAa,qBAAqB,iBAChC,gBAAG;;;;oBAIe,aAAa;;AAGjC,MAAa,iBAAiB,OAC5B,SACA,iBACqBA,oBAAO,QAAQ,MAAM,kBAAkB,aAAa,CAAC,CAAC;;;;ACpB7E,MAAa,qBAAyD;CACpE,cAAc;CACd,qBAAqB;CACrB,cAAc;EACZ,iBAAiB;EACjB,mBAAmB;EACnB,2BAA2B;EAC5B;CACD;CACA;CACA,oBAAoB,sBACjB,mBAAmB,kBAAkB,iBAAiB,GAAG;CAE7D;AAED,8BAA8B,SAAS,cAAc,mBAAmB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const require_core = require('./core-D5W_5J8k.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/storage/sqlite/core/schema/schema.ts
|
|
4
|
-
const defaultSQLiteDatabase = ":memory:";
|
|
5
|
-
const tableExistsSQL = (tableName) => require_core.SQL`
|
|
6
|
-
SELECT EXISTS (
|
|
7
|
-
SELECT 1
|
|
8
|
-
FROM sqlite_master
|
|
9
|
-
WHERE type = 'table' AND name = ${tableName}
|
|
10
|
-
) AS "exists"
|
|
11
|
-
`;
|
|
12
|
-
const tableExists = async (execute, tableName) => require_core.exists(execute.query(tableExistsSQL(tableName)));
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/storage/sqlite/core/schema/sqliteMetadata.ts
|
|
16
|
-
const sqliteMetadata = {
|
|
17
|
-
databaseType: "SQLite",
|
|
18
|
-
capabilities: {
|
|
19
|
-
supportsSchemas: false,
|
|
20
|
-
supportsFunctions: false,
|
|
21
|
-
supportsMultipleDatabases: false
|
|
22
|
-
},
|
|
23
|
-
tableExists
|
|
24
|
-
};
|
|
25
|
-
dumboDatabaseMetadataRegistry.register("SQLite", sqliteMetadata);
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
Object.defineProperty(exports, 'defaultSQLiteDatabase', {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return defaultSQLiteDatabase;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(exports, 'sqliteMetadata', {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return sqliteMetadata;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, 'tableExists', {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () {
|
|
43
|
-
return tableExists;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=sqliteMetadata-CpmoZxqb.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqliteMetadata-CpmoZxqb.cjs","names":["exists"],"sources":["../src/storage/sqlite/core/schema/schema.ts","../src/storage/sqlite/core/schema/sqliteMetadata.ts"],"sourcesContent":["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"],"mappings":";;;AAGA,MAAa,wBAAwB;AAErC,MAAM,kBAAkB,cACtB,gBAAG;;;;sCAIiC,UAAU;;;AAIhD,MAAa,cAAc,OACzB,SACA,cACqBA,oBAAO,QAAQ,MAAM,eAAe,UAAU,CAAC,CAAC;;;;ACdvE,MAAa,iBAAwD;CACnE,cAAc;CACd,cAAc;EACZ,iBAAiB;EACjB,mBAAmB;EACnB,2BAA2B;EAC5B;CACD;CACD;AAED,8BAA8B,SAAS,UAAU,eAAe"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ln as exists, xt as SQL } from "./core-BMeDuqBQ.js";
|
|
2
|
-
|
|
3
|
-
//#region src/storage/sqlite/core/schema/schema.ts
|
|
4
|
-
const defaultSQLiteDatabase = ":memory:";
|
|
5
|
-
const tableExistsSQL = (tableName) => SQL`
|
|
6
|
-
SELECT EXISTS (
|
|
7
|
-
SELECT 1
|
|
8
|
-
FROM sqlite_master
|
|
9
|
-
WHERE type = 'table' AND name = ${tableName}
|
|
10
|
-
) AS "exists"
|
|
11
|
-
`;
|
|
12
|
-
const tableExists = async (execute, tableName) => exists(execute.query(tableExistsSQL(tableName)));
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/storage/sqlite/core/schema/sqliteMetadata.ts
|
|
16
|
-
const sqliteMetadata = {
|
|
17
|
-
databaseType: "SQLite",
|
|
18
|
-
capabilities: {
|
|
19
|
-
supportsSchemas: false,
|
|
20
|
-
supportsFunctions: false,
|
|
21
|
-
supportsMultipleDatabases: false
|
|
22
|
-
},
|
|
23
|
-
tableExists
|
|
24
|
-
};
|
|
25
|
-
dumboDatabaseMetadataRegistry.register("SQLite", sqliteMetadata);
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { defaultSQLiteDatabase as n, tableExists as r, sqliteMetadata as t };
|
|
29
|
-
//# sourceMappingURL=sqliteMetadata-viYmVwA5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqliteMetadata-viYmVwA5.js","names":[],"sources":["../src/storage/sqlite/core/schema/schema.ts","../src/storage/sqlite/core/schema/sqliteMetadata.ts"],"sourcesContent":["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"],"mappings":";;;AAGA,MAAa,wBAAwB;AAErC,MAAM,kBAAkB,cACtB,GAAG;;;;sCAIiC,UAAU;;;AAIhD,MAAa,cAAc,OACzB,SACA,cACqB,OAAO,QAAQ,MAAM,eAAe,UAAU,CAAC,CAAC;;;;ACdvE,MAAa,iBAAwD;CACnE,cAAc;CACd,cAAc;EACZ,iBAAiB;EACjB,mBAAmB;EACnB,2BAA2B;EAC5B;CACD;CACD;AAED,8BAA8B,SAAS,UAAU,eAAe"}
|