text.cjs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 text_exports = {};
  20. __export(text_exports, {
  21. MySqlText: () => MySqlText,
  22. MySqlTextBuilder: () => MySqlTextBuilder,
  23. longtext: () => longtext,
  24. mediumtext: () => mediumtext,
  25. text: () => text,
  26. tinytext: () => tinytext
  27. });
  28. module.exports = __toCommonJS(text_exports);
  29. var import_entity = require("../../entity.cjs");
  30. var import_utils = require("../../utils.cjs");
  31. var import_common = require("./common.cjs");
  32. class MySqlTextBuilder extends import_common.MySqlColumnBuilder {
  33. static [import_entity.entityKind] = "MySqlTextBuilder";
  34. constructor(name, textType, config) {
  35. super(name, "string", "MySqlText");
  36. this.config.textType = textType;
  37. this.config.enumValues = config.enum;
  38. }
  39. /** @internal */
  40. build(table) {
  41. return new MySqlText(table, this.config);
  42. }
  43. }
  44. class MySqlText extends import_common.MySqlColumn {
  45. static [import_entity.entityKind] = "MySqlText";
  46. textType = this.config.textType;
  47. enumValues = this.config.enumValues;
  48. getSQLType() {
  49. return this.textType;
  50. }
  51. }
  52. function text(a, b = {}) {
  53. const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
  54. return new MySqlTextBuilder(name, "text", config);
  55. }
  56. function tinytext(a, b = {}) {
  57. const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
  58. return new MySqlTextBuilder(name, "tinytext", config);
  59. }
  60. function mediumtext(a, b = {}) {
  61. const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
  62. return new MySqlTextBuilder(name, "mediumtext", config);
  63. }
  64. function longtext(a, b = {}) {
  65. const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
  66. return new MySqlTextBuilder(name, "longtext", config);
  67. }
  68. // Annotate the CommonJS export names for ESM import in node:
  69. 0 && (module.exports = {
  70. MySqlText,
  71. MySqlTextBuilder,
  72. longtext,
  73. mediumtext,
  74. text,
  75. tinytext
  76. });
  77. //# sourceMappingURL=text.cjs.map