drizzle-orm 0.31.2-c59440c → 0.31.2-f9f4c2e
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/package.json +1 -1
- package/prisma/sqlite/session.cjs +6 -4
- package/prisma/sqlite/session.cjs.map +1 -1
- package/prisma/sqlite/session.d.cts +4 -4
- package/prisma/sqlite/session.d.ts +4 -4
- package/prisma/sqlite/session.js +6 -4
- package/prisma/sqlite/session.js.map +1 -1
- package/version.cjs +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -38,11 +38,13 @@ class PrismaSQLitePreparedQuery extends import_sqlite_core.SQLitePreparedQuery {
|
|
|
38
38
|
this.logger.logQuery(this.query.sql, params);
|
|
39
39
|
return this.prisma.$queryRawUnsafe(this.query.sql, ...params);
|
|
40
40
|
}
|
|
41
|
-
run(placeholderValues) {
|
|
42
|
-
|
|
41
|
+
async run(placeholderValues) {
|
|
42
|
+
await this.all(placeholderValues);
|
|
43
|
+
return [];
|
|
43
44
|
}
|
|
44
|
-
get(
|
|
45
|
-
|
|
45
|
+
async get(placeholderValues) {
|
|
46
|
+
const all = await this.all(placeholderValues);
|
|
47
|
+
return all[0];
|
|
46
48
|
}
|
|
47
49
|
values(_placeholderValues) {
|
|
48
50
|
throw new Error("Method not implemented.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prisma/sqlite/session.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport type { Query } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSelectedFieldsOrdered,\n\tSQLiteAsyncDialect,\n\tSQLiteExecuteMethod,\n\tSQLiteTransaction,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/index.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/index.ts';\n\ntype PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;\n\nexport class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<\n\t{ type: 'async'; run:
|
|
1
|
+
{"version":3,"sources":["../../../src/prisma/sqlite/session.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport type { Query } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSelectedFieldsOrdered,\n\tSQLiteAsyncDialect,\n\tSQLiteExecuteMethod,\n\tSQLiteTransaction,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/index.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/index.ts';\n\ntype PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;\n\nexport class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<\n\t{ type: 'async'; run: []; all: T['all']; get: T['get']; values: never; execute: T['execute'] }\n> {\n\tstatic readonly [entityKind]: string = 'PrismaSQLitePreparedQuery';\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tquery: Query,\n\t\tprivate readonly logger: Logger,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t) {\n\t\tsuper('async', executeMethod, query);\n\t}\n\n\toverride all(placeholderValues?: Record<string, unknown>): Promise<T['all']> {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.prisma.$queryRawUnsafe(this.query.sql, ...params);\n\t}\n\n\toverride async run(placeholderValues?: Record<string, unknown> | undefined): Promise<[]> {\n\t\tawait this.all(placeholderValues);\n\t\treturn [];\n\t}\n\n\toverride async get(placeholderValues?: Record<string, unknown> | undefined): Promise<T['get']> {\n\t\tconst all = await this.all(placeholderValues) as unknown[];\n\t\treturn all[0];\n\t}\n\n\toverride values(_placeholderValues?: Record<string, unknown> | undefined): Promise<never> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\n\toverride isResponseInArrayMode(): boolean {\n\t\treturn false;\n\t}\n}\n\nexport interface PrismaSQLiteSessionOptions {\n\tlogger?: Logger;\n}\n\nexport class PrismaSQLiteSession extends SQLiteSession<'async', unknown, Record<string, never>, Record<string, never>> {\n\tstatic readonly [entityKind]: string = 'PrismaSQLiteSession';\n\n\tprivate readonly logger: Logger;\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tdialect: SQLiteAsyncDialect,\n\t\toptions: PrismaSQLiteSessionOptions,\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t}\n\n\toverride prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t): PrismaSQLitePreparedQuery<T> {\n\t\treturn new PrismaSQLitePreparedQuery(this.prisma, query, this.logger, executeMethod);\n\t}\n\n\toverride transaction<T>(\n\t\t_transaction: (tx: SQLiteTransaction<'async', unknown, Record<string, never>, Record<string, never>>) => Promise<T>,\n\t\t_config?: SQLiteTransactionConfig,\n\t): Promise<T> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAC3B,oBAAwC;AAExC,iBAAiC;AASjC,yBAAmD;AAI5C,MAAM,kCAAuF,uCAElG;AAAA,EAGD,YACkB,QACjB,OACiB,QACjB,eACC;AACD,UAAM,SAAS,eAAe,KAAK;AALlB;AAEA;AAAA,EAIlB;AAAA,EATA,QAAiB,wBAAU,IAAY;AAAA,EAW9B,IAAI,mBAAgE;AAC5E,UAAM,aAAS,6BAAiB,KAAK,MAAM,QAAQ,qBAAqB,CAAC,CAAC;AAC1E,SAAK,OAAO,SAAS,KAAK,MAAM,KAAK,MAAM;AAC3C,WAAO,KAAK,OAAO,gBAAgB,KAAK,MAAM,KAAK,GAAG,MAAM;AAAA,EAC7D;AAAA,EAEA,MAAe,IAAI,mBAAsE;AACxF,UAAM,KAAK,IAAI,iBAAiB;AAChC,WAAO,CAAC;AAAA,EACT;AAAA,EAEA,MAAe,IAAI,mBAA4E;AAC9F,UAAM,MAAM,MAAM,KAAK,IAAI,iBAAiB;AAC5C,WAAO,IAAI,CAAC;AAAA,EACb;AAAA,EAES,OAAO,oBAA0E;AACzF,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAAA,EAES,wBAAiC;AACzC,WAAO;AAAA,EACR;AACD;AAMO,MAAM,4BAA4B,iCAA8E;AAAA,EAKtH,YACkB,QACjB,SACA,SACC;AACD,UAAM,OAAO;AAJI;AAKjB,SAAK,SAAS,QAAQ,UAAU,IAAI,yBAAW;AAAA,EAChD;AAAA,EAXA,QAAiB,wBAAU,IAAY;AAAA,EAEtB;AAAA,EAWR,aACR,OACA,QACA,eAC+B;AAC/B,WAAO,IAAI,0BAA0B,KAAK,QAAQ,OAAO,KAAK,QAAQ,aAAa;AAAA,EACpF;AAAA,EAES,YACR,cACA,SACa;AACb,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AACD;","names":[]}
|
|
@@ -7,9 +7,9 @@ import { SQLitePreparedQuery, SQLiteSession } from "../../sqlite-core/index.cjs"
|
|
|
7
7
|
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
|
|
8
8
|
export declare class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
|
|
9
9
|
type: 'async';
|
|
10
|
-
run:
|
|
10
|
+
run: [];
|
|
11
11
|
all: T['all'];
|
|
12
|
-
get:
|
|
12
|
+
get: T['get'];
|
|
13
13
|
values: never;
|
|
14
14
|
execute: T['execute'];
|
|
15
15
|
}> {
|
|
@@ -18,8 +18,8 @@ export declare class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = P
|
|
|
18
18
|
static readonly [entityKind]: string;
|
|
19
19
|
constructor(prisma: PrismaClient, query: Query, logger: Logger, executeMethod: SQLiteExecuteMethod);
|
|
20
20
|
all(placeholderValues?: Record<string, unknown>): Promise<T['all']>;
|
|
21
|
-
run(placeholderValues?: Record<string, unknown> | undefined): Promise<
|
|
22
|
-
get(
|
|
21
|
+
run(placeholderValues?: Record<string, unknown> | undefined): Promise<[]>;
|
|
22
|
+
get(placeholderValues?: Record<string, unknown> | undefined): Promise<T['get']>;
|
|
23
23
|
values(_placeholderValues?: Record<string, unknown> | undefined): Promise<never>;
|
|
24
24
|
isResponseInArrayMode(): boolean;
|
|
25
25
|
}
|
|
@@ -7,9 +7,9 @@ import { SQLitePreparedQuery, SQLiteSession } from "../../sqlite-core/index.js";
|
|
|
7
7
|
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
|
|
8
8
|
export declare class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
|
|
9
9
|
type: 'async';
|
|
10
|
-
run:
|
|
10
|
+
run: [];
|
|
11
11
|
all: T['all'];
|
|
12
|
-
get:
|
|
12
|
+
get: T['get'];
|
|
13
13
|
values: never;
|
|
14
14
|
execute: T['execute'];
|
|
15
15
|
}> {
|
|
@@ -18,8 +18,8 @@ export declare class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = P
|
|
|
18
18
|
static readonly [entityKind]: string;
|
|
19
19
|
constructor(prisma: PrismaClient, query: Query, logger: Logger, executeMethod: SQLiteExecuteMethod);
|
|
20
20
|
all(placeholderValues?: Record<string, unknown>): Promise<T['all']>;
|
|
21
|
-
run(placeholderValues?: Record<string, unknown> | undefined): Promise<
|
|
22
|
-
get(
|
|
21
|
+
run(placeholderValues?: Record<string, unknown> | undefined): Promise<[]>;
|
|
22
|
+
get(placeholderValues?: Record<string, unknown> | undefined): Promise<T['get']>;
|
|
23
23
|
values(_placeholderValues?: Record<string, unknown> | undefined): Promise<never>;
|
|
24
24
|
isResponseInArrayMode(): boolean;
|
|
25
25
|
}
|
package/prisma/sqlite/session.js
CHANGED
|
@@ -14,11 +14,13 @@ class PrismaSQLitePreparedQuery extends SQLitePreparedQuery {
|
|
|
14
14
|
this.logger.logQuery(this.query.sql, params);
|
|
15
15
|
return this.prisma.$queryRawUnsafe(this.query.sql, ...params);
|
|
16
16
|
}
|
|
17
|
-
run(placeholderValues) {
|
|
18
|
-
|
|
17
|
+
async run(placeholderValues) {
|
|
18
|
+
await this.all(placeholderValues);
|
|
19
|
+
return [];
|
|
19
20
|
}
|
|
20
|
-
get(
|
|
21
|
-
|
|
21
|
+
async get(placeholderValues) {
|
|
22
|
+
const all = await this.all(placeholderValues);
|
|
23
|
+
return all[0];
|
|
22
24
|
}
|
|
23
25
|
values(_placeholderValues) {
|
|
24
26
|
throw new Error("Method not implemented.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prisma/sqlite/session.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport type { Query } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSelectedFieldsOrdered,\n\tSQLiteAsyncDialect,\n\tSQLiteExecuteMethod,\n\tSQLiteTransaction,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/index.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/index.ts';\n\ntype PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;\n\nexport class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<\n\t{ type: 'async'; run:
|
|
1
|
+
{"version":3,"sources":["../../../src/prisma/sqlite/session.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { entityKind } from '~/entity.ts';\nimport { type Logger, NoopLogger } from '~/logger.ts';\nimport type { Query } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\nimport type {\n\tPreparedQueryConfig as PreparedQueryConfigBase,\n\tSelectedFieldsOrdered,\n\tSQLiteAsyncDialect,\n\tSQLiteExecuteMethod,\n\tSQLiteTransaction,\n\tSQLiteTransactionConfig,\n} from '~/sqlite-core/index.ts';\nimport { SQLitePreparedQuery, SQLiteSession } from '~/sqlite-core/index.ts';\n\ntype PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;\n\nexport class PrismaSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<\n\t{ type: 'async'; run: []; all: T['all']; get: T['get']; values: never; execute: T['execute'] }\n> {\n\tstatic readonly [entityKind]: string = 'PrismaSQLitePreparedQuery';\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tquery: Query,\n\t\tprivate readonly logger: Logger,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t) {\n\t\tsuper('async', executeMethod, query);\n\t}\n\n\toverride all(placeholderValues?: Record<string, unknown>): Promise<T['all']> {\n\t\tconst params = fillPlaceholders(this.query.params, placeholderValues ?? {});\n\t\tthis.logger.logQuery(this.query.sql, params);\n\t\treturn this.prisma.$queryRawUnsafe(this.query.sql, ...params);\n\t}\n\n\toverride async run(placeholderValues?: Record<string, unknown> | undefined): Promise<[]> {\n\t\tawait this.all(placeholderValues);\n\t\treturn [];\n\t}\n\n\toverride async get(placeholderValues?: Record<string, unknown> | undefined): Promise<T['get']> {\n\t\tconst all = await this.all(placeholderValues) as unknown[];\n\t\treturn all[0];\n\t}\n\n\toverride values(_placeholderValues?: Record<string, unknown> | undefined): Promise<never> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\n\toverride isResponseInArrayMode(): boolean {\n\t\treturn false;\n\t}\n}\n\nexport interface PrismaSQLiteSessionOptions {\n\tlogger?: Logger;\n}\n\nexport class PrismaSQLiteSession extends SQLiteSession<'async', unknown, Record<string, never>, Record<string, never>> {\n\tstatic readonly [entityKind]: string = 'PrismaSQLiteSession';\n\n\tprivate readonly logger: Logger;\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tdialect: SQLiteAsyncDialect,\n\t\toptions: PrismaSQLiteSessionOptions,\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t}\n\n\toverride prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(\n\t\tquery: Query,\n\t\tfields: SelectedFieldsOrdered | undefined,\n\t\texecuteMethod: SQLiteExecuteMethod,\n\t): PrismaSQLitePreparedQuery<T> {\n\t\treturn new PrismaSQLitePreparedQuery(this.prisma, query, this.logger, executeMethod);\n\t}\n\n\toverride transaction<T>(\n\t\t_transaction: (tx: SQLiteTransaction<'async', unknown, Record<string, never>, Record<string, never>>) => Promise<T>,\n\t\t_config?: SQLiteTransactionConfig,\n\t): Promise<T> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAC3B,SAAsB,kBAAkB;AAExC,SAAS,wBAAwB;AASjC,SAAS,qBAAqB,qBAAqB;AAI5C,MAAM,kCAAuF,oBAElG;AAAA,EAGD,YACkB,QACjB,OACiB,QACjB,eACC;AACD,UAAM,SAAS,eAAe,KAAK;AALlB;AAEA;AAAA,EAIlB;AAAA,EATA,QAAiB,UAAU,IAAY;AAAA,EAW9B,IAAI,mBAAgE;AAC5E,UAAM,SAAS,iBAAiB,KAAK,MAAM,QAAQ,qBAAqB,CAAC,CAAC;AAC1E,SAAK,OAAO,SAAS,KAAK,MAAM,KAAK,MAAM;AAC3C,WAAO,KAAK,OAAO,gBAAgB,KAAK,MAAM,KAAK,GAAG,MAAM;AAAA,EAC7D;AAAA,EAEA,MAAe,IAAI,mBAAsE;AACxF,UAAM,KAAK,IAAI,iBAAiB;AAChC,WAAO,CAAC;AAAA,EACT;AAAA,EAEA,MAAe,IAAI,mBAA4E;AAC9F,UAAM,MAAM,MAAM,KAAK,IAAI,iBAAiB;AAC5C,WAAO,IAAI,CAAC;AAAA,EACb;AAAA,EAES,OAAO,oBAA0E;AACzF,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAAA,EAES,wBAAiC;AACzC,WAAO;AAAA,EACR;AACD;AAMO,MAAM,4BAA4B,cAA8E;AAAA,EAKtH,YACkB,QACjB,SACA,SACC;AACD,UAAM,OAAO;AAJI;AAKjB,SAAK,SAAS,QAAQ,UAAU,IAAI,WAAW;AAAA,EAChD;AAAA,EAXA,QAAiB,UAAU,IAAY;AAAA,EAEtB;AAAA,EAWR,aACR,OACA,QACA,eAC+B;AAC/B,WAAO,IAAI,0BAA0B,KAAK,QAAQ,OAAO,KAAK,QAAQ,aAAa;AAAA,EACpF;AAAA,EAES,YACR,cACA,SACa;AACb,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AACD;","names":[]}
|
package/version.cjs
CHANGED
package/version.d.cts
CHANGED
package/version.d.ts
CHANGED
package/version.js
CHANGED