AK-21/Graphite-Industrial-Intelligence
0
1"use strict";2var __defProp = Object.defineProperty;3var __getOwnPropDesc = Object.getOwnPropertyDescriptor;4var __getOwnPropNames = Object.getOwnPropertyNames;5var __hasOwnProp = Object.prototype.hasOwnProperty;6var __export = (target, all) => {7 for (var name in all)8 __defProp(target, name, { get: all[name], enumerable: true });9};10var __copyProps = (to, from, except, desc) => {11 if (from && typeof from === "object" || typeof from === "function") {12 for (let key of __getOwnPropNames(from))13 if (!__hasOwnProp.call(to, key) && key !== except)14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });15 }16 return to;17};18var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);19var session_exports = {};20__export(session_exports, {21 PrismaMySqlPreparedQuery: () => PrismaMySqlPreparedQuery,22 PrismaMySqlSession: () => PrismaMySqlSession23});24module.exports = __toCommonJS(session_exports);25var import_entity = require("../../entity.cjs");26var import_logger = require("../../logger.cjs");27var import_mysql_core = require("../../mysql-core/index.cjs");28var import_sql = require("../../sql/sql.cjs");29class PrismaMySqlPreparedQuery extends import_mysql_core.MySqlPreparedQuery {30 constructor(prisma, query, logger) {31 super(void 0, void 0, void 0);32 this.prisma = prisma;33 this.query = query;34 this.logger = logger;35 }36 iterator(_placeholderValues) {37 throw new Error("Method not implemented.");38 }39 static [import_entity.entityKind] = "PrismaMySqlPreparedQuery";40 execute(placeholderValues) {41 const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});42 this.logger.logQuery(this.query.sql, params);43 return this.prisma.$queryRawUnsafe(this.query.sql, ...params);44 }45}46class PrismaMySqlSession extends import_mysql_core.MySqlSession {47 constructor(dialect, prisma, options) {48 super(dialect);49 this.prisma = prisma;50 this.options = options;51 this.logger = options.logger ?? new import_logger.NoopLogger();52 }53 static [import_entity.entityKind] = "PrismaMySqlSession";54 logger;55 execute(query) {56 return this.prepareQuery(this.dialect.sqlToQuery(query)).execute();57 }58 all(_query) {59 throw new Error("Method not implemented.");60 }61 prepareQuery(query) {62 return new PrismaMySqlPreparedQuery(this.prisma, query, this.logger);63 }64 transaction(_transaction, _config) {65 throw new Error("Method not implemented.");66 }67}68// Annotate the CommonJS export names for ESM import in node:690 && (module.exports = {70 PrismaMySqlPreparedQuery,71 PrismaMySqlSession72});73//# sourceMappingURL=session.cjs.map