raw.cjs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __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. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. var raw_exports = {};
  20. __export(raw_exports, {
  21. PgRaw: () => PgRaw
  22. });
  23. module.exports = __toCommonJS(raw_exports);
  24. var import_entity = require("../../entity.cjs");
  25. var import_query_promise = require("../../query-promise.cjs");
  26. class PgRaw extends import_query_promise.QueryPromise {
  27. constructor(execute, sql, query, mapBatchResult) {
  28. super();
  29. this.execute = execute;
  30. this.sql = sql;
  31. this.query = query;
  32. this.mapBatchResult = mapBatchResult;
  33. }
  34. static [import_entity.entityKind] = "PgRaw";
  35. /** @internal */
  36. getSQL() {
  37. return this.sql;
  38. }
  39. getQuery() {
  40. return this.query;
  41. }
  42. mapResult(result, isFromBatch) {
  43. return isFromBatch ? this.mapBatchResult(result) : result;
  44. }
  45. _prepare() {
  46. return this;
  47. }
  48. /** @internal */
  49. isResponseInArrayMode() {
  50. return false;
  51. }
  52. }
  53. // Annotate the CommonJS export names for ESM import in node:
  54. 0 && (module.exports = {
  55. PgRaw
  56. });
  57. //# sourceMappingURL=raw.cjs.map