MCPcopy Index your code
hub / github.com/sequelize/sequelize / TEXT

Class TEXT

src/data-types.js:114–142  ·  view source on GitHub ↗

* Unlimited length TEXT column

Source from the content-addressed store, hash-verified

112 * Unlimited length TEXT column
113 */
114class TEXT extends ABSTRACT {
115 /**
116 * @param {string} [length=''] could be tiny, medium, long.
117 */
118 constructor(length) {
119 super();
120 const options = typeof length === 'object' && length || { length };
121 this.options = options;
122 this._length = options.length || '';
123 }
124 toSql() {
125 switch (this._length.toLowerCase()) {
126 case 'tiny':
127 return 'TINYTEXT';
128 case 'medium':
129 return 'MEDIUMTEXT';
130 case 'long':
131 return 'LONGTEXT';
132 default:
133 return this.key;
134 }
135 }
136 validate(value) {
137 if (typeof value !== 'string') {
138 throw new sequelizeErrors.ValidationError(util.format('%j is not a valid string', value));
139 }
140 return true;
141 }
142}
143
144/**
145 * An unlimited length case-insensitive text column.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected