raw.cjs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. SQLiteRaw: () => SQLiteRaw
  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 SQLiteRaw extends import_query_promise.QueryPromise {
  27. constructor(execute, getSQL, action, dialect, mapBatchResult) {
  28. super();
  29. this.execute = execute;
  30. this.getSQL = getSQL;
  31. this.dialect = dialect;
  32. this.mapBatchResult = mapBatchResult;
  33. this.config = { action };
  34. }
  35. static [import_entity.entityKind] = "SQLiteRaw";
  36. /** @internal */
  37. config;
  38. getQuery() {
  39. return { ...this.dialect.sqlToQuery(this.getSQL()), method: this.config.action };
  40. }
  41. mapResult(result, isFromBatch) {
  42. return isFromBatch ? this.mapBatchResult(result) : result;
  43. }
  44. _prepare() {
  45. return this;
  46. }
  47. /** @internal */
  48. isResponseInArrayMode() {
  49. return false;
  50. }
  51. }
  52. // Annotate the CommonJS export names for ESM import in node:
  53. 0 && (module.exports = {
  54. SQLiteRaw
  55. });
  56. //# sourceMappingURL=raw.cjs.map