Initial commit

This commit is contained in:
Ammaar Reshi
2025-01-04 14:06:53 +00:00
parent 7082408604
commit d6025af146
23760 changed files with 3299690 additions and 0 deletions

58
node_modules/drizzle-orm/prisma/pg/driver.cjs generated vendored Normal file
View File

@ -0,0 +1,58 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var driver_exports = {};
__export(driver_exports, {
PrismaPgDatabase: () => PrismaPgDatabase,
drizzle: () => drizzle
});
module.exports = __toCommonJS(driver_exports);
var import_client = require("@prisma/client");
var import_entity = require("../../entity.cjs");
var import_logger = require("../../logger.cjs");
var import_pg_core = require("../../pg-core/index.cjs");
var import_session = require("./session.cjs");
class PrismaPgDatabase extends import_pg_core.PgDatabase {
static [import_entity.entityKind] = "PrismaPgDatabase";
constructor(client, logger) {
const dialect = new import_pg_core.PgDialect();
super(dialect, new import_session.PrismaPgSession(dialect, client, { logger }), void 0);
}
}
function drizzle(config = {}) {
let logger;
if (config.logger === true) {
logger = new import_logger.DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
return import_client.Prisma.defineExtension((client) => {
return client.$extends({
name: "drizzle",
client: {
$drizzle: new PrismaPgDatabase(client, logger)
}
});
});
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PrismaPgDatabase,
drizzle
});
//# sourceMappingURL=driver.cjs.map

1
node_modules/drizzle-orm/prisma/pg/driver.cjs.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/driver.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { Prisma } from '@prisma/client';\n\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase, PgDialect } from '~/pg-core/index.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport type { PrismaPgQueryResultHKT } from './session.ts';\nimport { PrismaPgSession } from './session.ts';\n\nexport class PrismaPgDatabase extends PgDatabase<PrismaPgQueryResultHKT, Record<string, never>> {\n\tstatic override readonly [entityKind]: string = 'PrismaPgDatabase';\n\n\tconstructor(client: PrismaClient, logger: Logger | undefined) {\n\t\tconst dialect = new PgDialect();\n\t\tsuper(dialect, new PrismaPgSession(dialect, client, { logger }), undefined);\n\t}\n}\n\nexport type PrismaPgConfig = Omit<DrizzleConfig, 'schema'>;\n\nexport function drizzle(config: PrismaPgConfig = {}) {\n\tlet logger: Logger | undefined;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\treturn Prisma.defineExtension((client) => {\n\t\treturn client.$extends({\n\t\t\tname: 'drizzle',\n\t\t\tclient: {\n\t\t\t\t$drizzle: new PrismaPgDatabase(client, logger),\n\t\t\t},\n\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAuB;AAEvB,oBAA2B;AAE3B,oBAA8B;AAC9B,qBAAsC;AAGtC,qBAAgC;AAEzB,MAAM,yBAAyB,0BAA0D;AAAA,EAC/F,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,QAAsB,QAA4B;AAC7D,UAAM,UAAU,IAAI,yBAAU;AAC9B,UAAM,SAAS,IAAI,+BAAgB,SAAS,QAAQ,EAAE,OAAO,CAAC,GAAG,MAAS;AAAA,EAC3E;AACD;AAIO,SAAS,QAAQ,SAAyB,CAAC,GAAG;AACpD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,4BAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,SAAO,qBAAO,gBAAgB,CAAC,WAAW;AACzC,WAAO,OAAO,SAAS;AAAA,MACtB,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,UAAU,IAAI,iBAAiB,QAAQ,MAAM;AAAA,MAC9C;AAAA,IACD,CAAC;AAAA,EACF,CAAC;AACF;","names":[]}

23
node_modules/drizzle-orm/prisma/pg/driver.d.cts generated vendored Normal file
View File

@ -0,0 +1,23 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.cjs";
import type { Logger } from "../../logger.cjs";
import { PgDatabase } from "../../pg-core/index.cjs";
import type { DrizzleConfig } from "../../utils.cjs";
import type { PrismaPgQueryResultHKT } from "./session.cjs";
export declare class PrismaPgDatabase extends PgDatabase<PrismaPgQueryResultHKT, Record<string, never>> {
static readonly [entityKind]: string;
constructor(client: PrismaClient, logger: Logger | undefined);
}
export type PrismaPgConfig = Omit<DrizzleConfig, 'schema'>;
export declare function drizzle(config?: PrismaPgConfig): (client: any) => {
$extends: {
extArgs: {
result: {};
model: {};
query: {};
client: {
$drizzle: () => PrismaPgDatabase;
};
};
};
};

23
node_modules/drizzle-orm/prisma/pg/driver.d.ts generated vendored Normal file
View File

@ -0,0 +1,23 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.js";
import type { Logger } from "../../logger.js";
import { PgDatabase } from "../../pg-core/index.js";
import type { DrizzleConfig } from "../../utils.js";
import type { PrismaPgQueryResultHKT } from "./session.js";
export declare class PrismaPgDatabase extends PgDatabase<PrismaPgQueryResultHKT, Record<string, never>> {
static readonly [entityKind]: string;
constructor(client: PrismaClient, logger: Logger | undefined);
}
export type PrismaPgConfig = Omit<DrizzleConfig, 'schema'>;
export declare function drizzle(config?: PrismaPgConfig): (client: any) => {
$extends: {
extArgs: {
result: {};
model: {};
query: {};
client: {
$drizzle: () => PrismaPgDatabase;
};
};
};
};

33
node_modules/drizzle-orm/prisma/pg/driver.js generated vendored Normal file
View File

@ -0,0 +1,33 @@
import { Prisma } from "@prisma/client";
import { entityKind } from "../../entity.js";
import { DefaultLogger } from "../../logger.js";
import { PgDatabase, PgDialect } from "../../pg-core/index.js";
import { PrismaPgSession } from "./session.js";
class PrismaPgDatabase extends PgDatabase {
static [entityKind] = "PrismaPgDatabase";
constructor(client, logger) {
const dialect = new PgDialect();
super(dialect, new PrismaPgSession(dialect, client, { logger }), void 0);
}
}
function drizzle(config = {}) {
let logger;
if (config.logger === true) {
logger = new DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
return Prisma.defineExtension((client) => {
return client.$extends({
name: "drizzle",
client: {
$drizzle: new PrismaPgDatabase(client, logger)
}
});
});
}
export {
PrismaPgDatabase,
drizzle
};
//# sourceMappingURL=driver.js.map

1
node_modules/drizzle-orm/prisma/pg/driver.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/driver.ts"],"sourcesContent":["import type { PrismaClient } from '@prisma/client/extension';\n\nimport { Prisma } from '@prisma/client';\n\nimport { entityKind } from '~/entity.ts';\nimport type { Logger } from '~/logger.ts';\nimport { DefaultLogger } from '~/logger.ts';\nimport { PgDatabase, PgDialect } from '~/pg-core/index.ts';\nimport type { DrizzleConfig } from '~/utils.ts';\nimport type { PrismaPgQueryResultHKT } from './session.ts';\nimport { PrismaPgSession } from './session.ts';\n\nexport class PrismaPgDatabase extends PgDatabase<PrismaPgQueryResultHKT, Record<string, never>> {\n\tstatic override readonly [entityKind]: string = 'PrismaPgDatabase';\n\n\tconstructor(client: PrismaClient, logger: Logger | undefined) {\n\t\tconst dialect = new PgDialect();\n\t\tsuper(dialect, new PrismaPgSession(dialect, client, { logger }), undefined);\n\t}\n}\n\nexport type PrismaPgConfig = Omit<DrizzleConfig, 'schema'>;\n\nexport function drizzle(config: PrismaPgConfig = {}) {\n\tlet logger: Logger | undefined;\n\tif (config.logger === true) {\n\t\tlogger = new DefaultLogger();\n\t} else if (config.logger !== false) {\n\t\tlogger = config.logger;\n\t}\n\n\treturn Prisma.defineExtension((client) => {\n\t\treturn client.$extends({\n\t\t\tname: 'drizzle',\n\t\t\tclient: {\n\t\t\t\t$drizzle: new PrismaPgDatabase(client, logger),\n\t\t\t},\n\t\t});\n\t});\n}\n"],"mappings":"AAEA,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,YAAY,iBAAiB;AAGtC,SAAS,uBAAuB;AAEzB,MAAM,yBAAyB,WAA0D;AAAA,EAC/F,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,QAAsB,QAA4B;AAC7D,UAAM,UAAU,IAAI,UAAU;AAC9B,UAAM,SAAS,IAAI,gBAAgB,SAAS,QAAQ,EAAE,OAAO,CAAC,GAAG,MAAS;AAAA,EAC3E;AACD;AAIO,SAAS,QAAQ,SAAyB,CAAC,GAAG;AACpD,MAAI;AACJ,MAAI,OAAO,WAAW,MAAM;AAC3B,aAAS,IAAI,cAAc;AAAA,EAC5B,WAAW,OAAO,WAAW,OAAO;AACnC,aAAS,OAAO;AAAA,EACjB;AAEA,SAAO,OAAO,gBAAgB,CAAC,WAAW;AACzC,WAAO,OAAO,SAAS;AAAA,MACtB,MAAM;AAAA,MACN,QAAQ;AAAA,QACP,UAAU,IAAI,iBAAiB,QAAQ,MAAM;AAAA,MAC9C;AAAA,IACD,CAAC;AAAA,EACF,CAAC;AACF;","names":[]}

25
node_modules/drizzle-orm/prisma/pg/index.cjs generated vendored Normal file
View File

@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var pg_exports = {};
module.exports = __toCommonJS(pg_exports);
__reExport(pg_exports, require("./driver.cjs"), module.exports);
__reExport(pg_exports, require("./session.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./driver.cjs"),
...require("./session.cjs")
});
//# sourceMappingURL=index.cjs.map

1
node_modules/drizzle-orm/prisma/pg/index.cjs.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAc,wBAAd;AACA,uBAAc,yBADd;","names":[]}

2
node_modules/drizzle-orm/prisma/pg/index.d.cts generated vendored Normal file
View File

@ -0,0 +1,2 @@
export * from "./driver.cjs";
export * from "./session.cjs";

2
node_modules/drizzle-orm/prisma/pg/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
export * from "./driver.js";
export * from "./session.js";

3
node_modules/drizzle-orm/prisma/pg/index.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
export * from "./driver.js";
export * from "./session.js";
//# sourceMappingURL=index.js.map

1
node_modules/drizzle-orm/prisma/pg/index.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}

72
node_modules/drizzle-orm/prisma/pg/session.cjs generated vendored Normal file
View File

@ -0,0 +1,72 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var session_exports = {};
__export(session_exports, {
PrismaPgPreparedQuery: () => PrismaPgPreparedQuery,
PrismaPgSession: () => PrismaPgSession
});
module.exports = __toCommonJS(session_exports);
var import_entity = require("../../entity.cjs");
var import_logger = require("../../logger.cjs");
var import_pg_core = require("../../pg-core/index.cjs");
var import_sql = require("../../sql/sql.cjs");
class PrismaPgPreparedQuery extends import_pg_core.PgPreparedQuery {
constructor(prisma, query, logger) {
super(query);
this.prisma = prisma;
this.logger = logger;
}
static [import_entity.entityKind] = "PrismaPgPreparedQuery";
execute(placeholderValues) {
const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return this.prisma.$queryRawUnsafe(this.query.sql, ...params);
}
all() {
throw new Error("Method not implemented.");
}
isResponseInArrayMode() {
return false;
}
}
class PrismaPgSession extends import_pg_core.PgSession {
constructor(dialect, prisma, options) {
super(dialect);
this.prisma = prisma;
this.options = options;
this.logger = options.logger ?? new import_logger.NoopLogger();
}
static [import_entity.entityKind] = "PrismaPgSession";
logger;
execute(query) {
return this.prepareQuery(this.dialect.sqlToQuery(query)).execute();
}
prepareQuery(query) {
return new PrismaPgPreparedQuery(this.prisma, query, this.logger);
}
transaction(_transaction, _config) {
throw new Error("Method not implemented.");
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PrismaPgPreparedQuery,
PrismaPgSession
});
//# sourceMappingURL=session.cjs.map

1
node_modules/drizzle-orm/prisma/pg/session.cjs.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/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 {\n\tPgDialect,\n\tPgQueryResultHKT,\n\tPgTransaction,\n\tPgTransactionConfig,\n\tPreparedQueryConfig,\n} from '~/pg-core/index.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/index.ts';\nimport type { Query, SQL } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\n\nexport class PrismaPgPreparedQuery<T> extends PgPreparedQuery<PreparedQueryConfig & { execute: T }> {\n\tstatic override readonly [entityKind]: string = 'PrismaPgPreparedQuery';\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tquery: Query,\n\t\tprivate readonly logger: Logger,\n\t) {\n\t\tsuper(query);\n\t}\n\n\toverride execute(placeholderValues?: Record<string, unknown>): Promise<T> {\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 all(): Promise<unknown> {\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 PrismaPgSessionOptions {\n\tlogger?: Logger;\n}\n\nexport class PrismaPgSession extends PgSession {\n\tstatic override readonly [entityKind]: string = 'PrismaPgSession';\n\n\tprivate readonly logger: Logger;\n\n\tconstructor(\n\t\tdialect: PgDialect,\n\t\tprivate readonly prisma: PrismaClient,\n\t\tprivate readonly options: PrismaPgSessionOptions,\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t}\n\n\toverride execute<T>(query: SQL): Promise<T> {\n\t\treturn this.prepareQuery<PreparedQueryConfig & { execute: T }>(this.dialect.sqlToQuery(query)).execute();\n\t}\n\n\toverride prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query): PgPreparedQuery<T> {\n\t\treturn new PrismaPgPreparedQuery(this.prisma, query, this.logger);\n\t}\n\n\toverride transaction<T>(\n\t\t_transaction: (tx: PgTransaction<PgQueryResultHKT, Record<string, never>, Record<string, never>>) => Promise<T>,\n\t\t_config?: PgTransactionConfig,\n\t): Promise<T> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n\nexport interface PrismaPgQueryResultHKT extends PgQueryResultHKT {\n\ttype: [];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAC3B,oBAAwC;AAQxC,qBAA2C;AAE3C,iBAAiC;AAE1B,MAAM,8BAAiC,+BAAsD;AAAA,EAGnG,YACkB,QACjB,OACiB,QAChB;AACD,UAAM,KAAK;AAJM;AAEA;AAAA,EAGlB;AAAA,EARA,QAA0B,wBAAU,IAAY;AAAA,EAUvC,QAAQ,mBAAyD;AACzE,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,EAES,MAAwB;AAChC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAAA,EAES,wBAAiC;AACzC,WAAO;AAAA,EACR;AACD;AAMO,MAAM,wBAAwB,yBAAU;AAAA,EAK9C,YACC,SACiB,QACA,SAChB;AACD,UAAM,OAAO;AAHI;AACA;AAGjB,SAAK,SAAS,QAAQ,UAAU,IAAI,yBAAW;AAAA,EAChD;AAAA,EAXA,QAA0B,wBAAU,IAAY;AAAA,EAE/B;AAAA,EAWR,QAAW,OAAwB;AAC3C,WAAO,KAAK,aAAmD,KAAK,QAAQ,WAAW,KAAK,CAAC,EAAE,QAAQ;AAAA,EACxG;AAAA,EAES,aAAkE,OAAkC;AAC5G,WAAO,IAAI,sBAAsB,KAAK,QAAQ,OAAO,KAAK,MAAM;AAAA,EACjE;AAAA,EAES,YACR,cACA,SACa;AACb,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AACD;","names":[]}

33
node_modules/drizzle-orm/prisma/pg/session.d.cts generated vendored Normal file
View File

@ -0,0 +1,33 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.cjs";
import { type Logger } from "../../logger.cjs";
import type { PgDialect, PgQueryResultHKT, PgTransaction, PgTransactionConfig, PreparedQueryConfig } from "../../pg-core/index.cjs";
import { PgPreparedQuery, PgSession } from "../../pg-core/index.cjs";
import type { Query, SQL } from "../../sql/sql.cjs";
export declare class PrismaPgPreparedQuery<T> extends PgPreparedQuery<PreparedQueryConfig & {
execute: T;
}> {
private readonly prisma;
private readonly logger;
static readonly [entityKind]: string;
constructor(prisma: PrismaClient, query: Query, logger: Logger);
execute(placeholderValues?: Record<string, unknown>): Promise<T>;
all(): Promise<unknown>;
isResponseInArrayMode(): boolean;
}
export interface PrismaPgSessionOptions {
logger?: Logger;
}
export declare class PrismaPgSession extends PgSession {
private readonly prisma;
private readonly options;
static readonly [entityKind]: string;
private readonly logger;
constructor(dialect: PgDialect, prisma: PrismaClient, options: PrismaPgSessionOptions);
execute<T>(query: SQL): Promise<T>;
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query): PgPreparedQuery<T>;
transaction<T>(_transaction: (tx: PgTransaction<PgQueryResultHKT, Record<string, never>, Record<string, never>>) => Promise<T>, _config?: PgTransactionConfig): Promise<T>;
}
export interface PrismaPgQueryResultHKT extends PgQueryResultHKT {
type: [];
}

33
node_modules/drizzle-orm/prisma/pg/session.d.ts generated vendored Normal file
View File

@ -0,0 +1,33 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.js";
import { type Logger } from "../../logger.js";
import type { PgDialect, PgQueryResultHKT, PgTransaction, PgTransactionConfig, PreparedQueryConfig } from "../../pg-core/index.js";
import { PgPreparedQuery, PgSession } from "../../pg-core/index.js";
import type { Query, SQL } from "../../sql/sql.js";
export declare class PrismaPgPreparedQuery<T> extends PgPreparedQuery<PreparedQueryConfig & {
execute: T;
}> {
private readonly prisma;
private readonly logger;
static readonly [entityKind]: string;
constructor(prisma: PrismaClient, query: Query, logger: Logger);
execute(placeholderValues?: Record<string, unknown>): Promise<T>;
all(): Promise<unknown>;
isResponseInArrayMode(): boolean;
}
export interface PrismaPgSessionOptions {
logger?: Logger;
}
export declare class PrismaPgSession extends PgSession {
private readonly prisma;
private readonly options;
static readonly [entityKind]: string;
private readonly logger;
constructor(dialect: PgDialect, prisma: PrismaClient, options: PrismaPgSessionOptions);
execute<T>(query: SQL): Promise<T>;
prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query): PgPreparedQuery<T>;
transaction<T>(_transaction: (tx: PgTransaction<PgQueryResultHKT, Record<string, never>, Record<string, never>>) => Promise<T>, _config?: PgTransactionConfig): Promise<T>;
}
export interface PrismaPgQueryResultHKT extends PgQueryResultHKT {
type: [];
}

47
node_modules/drizzle-orm/prisma/pg/session.js generated vendored Normal file
View File

@ -0,0 +1,47 @@
import { entityKind } from "../../entity.js";
import { NoopLogger } from "../../logger.js";
import { PgPreparedQuery, PgSession } from "../../pg-core/index.js";
import { fillPlaceholders } from "../../sql/sql.js";
class PrismaPgPreparedQuery extends PgPreparedQuery {
constructor(prisma, query, logger) {
super(query);
this.prisma = prisma;
this.logger = logger;
}
static [entityKind] = "PrismaPgPreparedQuery";
execute(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return this.prisma.$queryRawUnsafe(this.query.sql, ...params);
}
all() {
throw new Error("Method not implemented.");
}
isResponseInArrayMode() {
return false;
}
}
class PrismaPgSession extends PgSession {
constructor(dialect, prisma, options) {
super(dialect);
this.prisma = prisma;
this.options = options;
this.logger = options.logger ?? new NoopLogger();
}
static [entityKind] = "PrismaPgSession";
logger;
execute(query) {
return this.prepareQuery(this.dialect.sqlToQuery(query)).execute();
}
prepareQuery(query) {
return new PrismaPgPreparedQuery(this.prisma, query, this.logger);
}
transaction(_transaction, _config) {
throw new Error("Method not implemented.");
}
}
export {
PrismaPgPreparedQuery,
PrismaPgSession
};
//# sourceMappingURL=session.js.map

1
node_modules/drizzle-orm/prisma/pg/session.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../src/prisma/pg/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 {\n\tPgDialect,\n\tPgQueryResultHKT,\n\tPgTransaction,\n\tPgTransactionConfig,\n\tPreparedQueryConfig,\n} from '~/pg-core/index.ts';\nimport { PgPreparedQuery, PgSession } from '~/pg-core/index.ts';\nimport type { Query, SQL } from '~/sql/sql.ts';\nimport { fillPlaceholders } from '~/sql/sql.ts';\n\nexport class PrismaPgPreparedQuery<T> extends PgPreparedQuery<PreparedQueryConfig & { execute: T }> {\n\tstatic override readonly [entityKind]: string = 'PrismaPgPreparedQuery';\n\n\tconstructor(\n\t\tprivate readonly prisma: PrismaClient,\n\t\tquery: Query,\n\t\tprivate readonly logger: Logger,\n\t) {\n\t\tsuper(query);\n\t}\n\n\toverride execute(placeholderValues?: Record<string, unknown>): Promise<T> {\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 all(): Promise<unknown> {\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 PrismaPgSessionOptions {\n\tlogger?: Logger;\n}\n\nexport class PrismaPgSession extends PgSession {\n\tstatic override readonly [entityKind]: string = 'PrismaPgSession';\n\n\tprivate readonly logger: Logger;\n\n\tconstructor(\n\t\tdialect: PgDialect,\n\t\tprivate readonly prisma: PrismaClient,\n\t\tprivate readonly options: PrismaPgSessionOptions,\n\t) {\n\t\tsuper(dialect);\n\t\tthis.logger = options.logger ?? new NoopLogger();\n\t}\n\n\toverride execute<T>(query: SQL): Promise<T> {\n\t\treturn this.prepareQuery<PreparedQueryConfig & { execute: T }>(this.dialect.sqlToQuery(query)).execute();\n\t}\n\n\toverride prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query): PgPreparedQuery<T> {\n\t\treturn new PrismaPgPreparedQuery(this.prisma, query, this.logger);\n\t}\n\n\toverride transaction<T>(\n\t\t_transaction: (tx: PgTransaction<PgQueryResultHKT, Record<string, never>, Record<string, never>>) => Promise<T>,\n\t\t_config?: PgTransactionConfig,\n\t): Promise<T> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n}\n\nexport interface PrismaPgQueryResultHKT extends PgQueryResultHKT {\n\ttype: [];\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAC3B,SAAsB,kBAAkB;AAQxC,SAAS,iBAAiB,iBAAiB;AAE3C,SAAS,wBAAwB;AAE1B,MAAM,8BAAiC,gBAAsD;AAAA,EAGnG,YACkB,QACjB,OACiB,QAChB;AACD,UAAM,KAAK;AAJM;AAEA;AAAA,EAGlB;AAAA,EARA,QAA0B,UAAU,IAAY;AAAA,EAUvC,QAAQ,mBAAyD;AACzE,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,EAES,MAAwB;AAChC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAAA,EAES,wBAAiC;AACzC,WAAO;AAAA,EACR;AACD;AAMO,MAAM,wBAAwB,UAAU;AAAA,EAK9C,YACC,SACiB,QACA,SAChB;AACD,UAAM,OAAO;AAHI;AACA;AAGjB,SAAK,SAAS,QAAQ,UAAU,IAAI,WAAW;AAAA,EAChD;AAAA,EAXA,QAA0B,UAAU,IAAY;AAAA,EAE/B;AAAA,EAWR,QAAW,OAAwB;AAC3C,WAAO,KAAK,aAAmD,KAAK,QAAQ,WAAW,KAAK,CAAC,EAAE,QAAQ;AAAA,EACxG;AAAA,EAES,aAAkE,OAAkC;AAC5G,WAAO,IAAI,sBAAsB,KAAK,QAAQ,OAAO,KAAK,MAAM;AAAA,EACjE;AAAA,EAES,YACR,cACA,SACa;AACb,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AACD;","names":[]}