tspace-mysql 1.6.6-dev.1.2 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ let globalSettings = {
26
26
  debug: false,
27
27
  uuid: false,
28
28
  timestamp: false,
29
+ pattern: false,
29
30
  logger: {
30
31
  selected: false,
31
32
  inserted: false,
@@ -2068,7 +2069,6 @@ class Model extends AbstractModel_1.AbstractModel {
2068
2069
  if (typeof column === 'object') {
2069
2070
  return this.whereObject(column);
2070
2071
  }
2071
- const c = this._columnPattern(String(column));
2072
2072
  [value, operator] = this._valueAndOperator(value, operator, arguments.length === 2);
2073
2073
  value = this.$utils.escape(value);
2074
2074
  value = this._valueTrueFalse(value);
@@ -2082,7 +2082,7 @@ class Model extends AbstractModel_1.AbstractModel {
2082
2082
  ...this.$state.get('WHERE'),
2083
2083
  [
2084
2084
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2085
- `${this.bindColumn(String(c))}`,
2085
+ `${this.bindColumn(String(column))}`,
2086
2086
  `${operator}`,
2087
2087
  `${this._checkValueHasRaw(value)}`
2088
2088
  ].join(' ')
@@ -2098,7 +2098,6 @@ class Model extends AbstractModel_1.AbstractModel {
2098
2098
  */
2099
2099
  orWhere(column, operator, value) {
2100
2100
  [value, operator] = this._valueAndOperator(value, operator, arguments.length === 2);
2101
- const c = this._columnPattern(String(column));
2102
2101
  value = this.$utils.escape(value);
2103
2102
  value = this._valueTrueFalse(value);
2104
2103
  if (value === null) {
@@ -2111,7 +2110,7 @@ class Model extends AbstractModel_1.AbstractModel {
2111
2110
  ...this.$state.get('WHERE'),
2112
2111
  [
2113
2112
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2114
- `${this.bindColumn(String(c))}`,
2113
+ `${this.bindColumn(String(column))}`,
2115
2114
  `${operator}`,
2116
2115
  `${this._checkValueHasRaw(value)}`
2117
2116
  ].join(' ')
@@ -2181,7 +2180,7 @@ class Model extends AbstractModel_1.AbstractModel {
2181
2180
  for (let column in columns) {
2182
2181
  const operator = '=';
2183
2182
  const value = this.$utils.escape(columns[column]);
2184
- const c = this._columnPattern(String(column));
2183
+ const c = String(column);
2185
2184
  if (value === null) {
2186
2185
  this.whereNull(column);
2187
2186
  continue;
@@ -2201,51 +2200,51 @@ class Model extends AbstractModel_1.AbstractModel {
2201
2200
  }
2202
2201
  switch (useOp.op) {
2203
2202
  case 'IN': {
2204
- this.whereIn(column, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2203
+ this.whereIn(c, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2205
2204
  break;
2206
2205
  }
2207
2206
  case '|IN': {
2208
- this.orWhereIn(column, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2207
+ this.orWhereIn(c, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2209
2208
  break;
2210
2209
  }
2211
2210
  case 'QUERY': {
2212
- this.whereSubQuery(column, useOp.value);
2211
+ this.whereSubQuery(c, useOp.value);
2213
2212
  break;
2214
2213
  }
2215
2214
  case '!QUERY': {
2216
- this.orWhereSubQuery(column, useOp.value);
2215
+ this.orWhereSubQuery(c, useOp.value);
2217
2216
  break;
2218
2217
  }
2219
2218
  case 'NOT IN': {
2220
- this.whereNotIn(column, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2219
+ this.whereNotIn(c, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2221
2220
  break;
2222
2221
  }
2223
2222
  case '|NOT IN': {
2224
- this.orWhereNotIn(column, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2223
+ this.orWhereNotIn(c, Array.isArray(useOp.value) ? useOp.value : useOp.value.split(','));
2225
2224
  break;
2226
2225
  }
2227
2226
  case 'IS NULL': {
2228
- this.whereNull(column);
2227
+ this.whereNull(c);
2229
2228
  break;
2230
2229
  }
2231
2230
  case '|IS NULL': {
2232
- this.orWhereNull(column);
2231
+ this.orWhereNull(c);
2233
2232
  break;
2234
2233
  }
2235
2234
  case 'IS NOT NULL': {
2236
- this.whereNotNull(column);
2235
+ this.whereNotNull(c);
2237
2236
  break;
2238
2237
  }
2239
2238
  case '|IS NOT NULL': {
2240
- this.orWhereNotNull(column);
2239
+ this.orWhereNotNull(c);
2241
2240
  break;
2242
2241
  }
2243
2242
  default: {
2244
2243
  if (useOp.op.includes('|')) {
2245
- this.orWhere(column, useOp.op.replace('|', ''), useOp.value);
2244
+ this.orWhere(c, useOp.op.replace('|', ''), useOp.value);
2246
2245
  break;
2247
2246
  }
2248
- this.where(column, useOp.op, useOp.value);
2247
+ this.where(c, useOp.op, useOp.value);
2249
2248
  }
2250
2249
  }
2251
2250
  }
@@ -2263,18 +2262,29 @@ class Model extends AbstractModel_1.AbstractModel {
2263
2262
  whereJSON(column, { key, value, operator }) {
2264
2263
  value = this.$utils.escape(value);
2265
2264
  value = this._valueTrueFalse(value);
2266
- const c = this._columnPattern(String(column));
2267
2265
  this.$state.set('WHERE', [
2268
2266
  ...this.$state.get('WHERE'),
2269
2267
  [
2270
2268
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2271
- `${this.bindColumn(c)}->>'$.${key}'`,
2269
+ `${this.bindColumn(String(column))}->>'$.${key}'`,
2272
2270
  `${operator == null ? "=" : operator.toLocaleUpperCase()}`,
2273
2271
  `${this._checkValueHasRaw(value)}`
2274
2272
  ].join(' ')
2275
2273
  ]);
2276
2274
  return this;
2277
2275
  }
2276
+ /**
2277
+ * @override
2278
+ * @param {string} column
2279
+ * @param {object} property object { key , value , operator }
2280
+ * @property {string} property.key
2281
+ * @property {string} property.value
2282
+ * @property {string?} property.operator
2283
+ * @returns {this}
2284
+ */
2285
+ whereJson(column, { key, value, operator }) {
2286
+ return this.whereJSON(column, { key, value, operator });
2287
+ }
2278
2288
  /**
2279
2289
  * @override
2280
2290
  * @param {number} userId
@@ -2282,7 +2292,6 @@ class Model extends AbstractModel_1.AbstractModel {
2282
2292
  * @returns {this}
2283
2293
  */
2284
2294
  whereUser(userId, column = 'user_id') {
2285
- column = this._columnPattern(String(column));
2286
2295
  this.$state.set('WHERE', [
2287
2296
  ...this.$state.get('WHERE'),
2288
2297
  [
@@ -2302,7 +2311,6 @@ class Model extends AbstractModel_1.AbstractModel {
2302
2311
  if (!Array.isArray(array)) {
2303
2312
  throw this._assertError("This method must require the value to be an array only.");
2304
2313
  }
2305
- const c = this._columnPattern(String(column));
2306
2314
  const values = array.length
2307
2315
  ? `${array.map((value) => this._checkValueHasRaw(this.$utils.escape(value))).join(',')}`
2308
2316
  : this.$constants(this.$constants('NULL'));
@@ -2310,7 +2318,7 @@ class Model extends AbstractModel_1.AbstractModel {
2310
2318
  ...this.$state.get('WHERE'),
2311
2319
  [
2312
2320
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2313
- `${this.bindColumn(c)}`,
2321
+ `${this.bindColumn(String(column))}`,
2314
2322
  `${this.$constants('IN')}`,
2315
2323
  `(${values})`
2316
2324
  ].join(' ')
@@ -2327,7 +2335,6 @@ class Model extends AbstractModel_1.AbstractModel {
2327
2335
  if (!Array.isArray(array)) {
2328
2336
  throw this._assertError("This method must require the value to be an array only.");
2329
2337
  }
2330
- const c = this._columnPattern(String(column));
2331
2338
  const values = array.length
2332
2339
  ? `${array.map((value) => this._checkValueHasRaw(this.$utils.escape(value))).join(',')}`
2333
2340
  : this.$constants(this.$constants('NULL'));
@@ -2335,7 +2342,7 @@ class Model extends AbstractModel_1.AbstractModel {
2335
2342
  ...this.$state.get('WHERE'),
2336
2343
  [
2337
2344
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2338
- `${this.bindColumn(c)}`,
2345
+ `${this.bindColumn(String(column))}`,
2339
2346
  `${this.$constants('IN')}`,
2340
2347
  `(${values})`
2341
2348
  ].join(' ')
@@ -2352,7 +2359,6 @@ class Model extends AbstractModel_1.AbstractModel {
2352
2359
  if (!Array.isArray(array)) {
2353
2360
  throw this._assertError("This method must require the value to be an array only.");
2354
2361
  }
2355
- const c = this._columnPattern(String(column));
2356
2362
  if (!array.length)
2357
2363
  return this;
2358
2364
  const values = `${array.map((value) => this._checkValueHasRaw(this.$utils.escape(value))).join(',')}`;
@@ -2360,7 +2366,7 @@ class Model extends AbstractModel_1.AbstractModel {
2360
2366
  ...this.$state.get('WHERE'),
2361
2367
  [
2362
2368
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2363
- `${this.bindColumn(c)}`,
2369
+ `${this.bindColumn(String(column))}`,
2364
2370
  `${this.$constants('NOT_IN')}`,
2365
2371
  `(${values})`
2366
2372
  ].join(' ')
@@ -2377,7 +2383,6 @@ class Model extends AbstractModel_1.AbstractModel {
2377
2383
  if (!Array.isArray(array)) {
2378
2384
  this._assertError(`This 'orWhereNotIn' method is required array only`);
2379
2385
  }
2380
- const c = this._columnPattern(String(column));
2381
2386
  if (!array.length)
2382
2387
  return this;
2383
2388
  const values = `${array.map((value) => this._checkValueHasRaw(this.$utils.escape(value))).join(',')}`;
@@ -2385,7 +2390,7 @@ class Model extends AbstractModel_1.AbstractModel {
2385
2390
  ...this.$state.get('WHERE'),
2386
2391
  [
2387
2392
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2388
- `${this.bindColumn(c)}`,
2393
+ `${this.bindColumn(String(column))}`,
2389
2394
  `${this.$constants('NOT_IN')}`,
2390
2395
  `(${values})`
2391
2396
  ].join(' ')
@@ -2399,12 +2404,11 @@ class Model extends AbstractModel_1.AbstractModel {
2399
2404
  * @returns {this}
2400
2405
  */
2401
2406
  whereSubQuery(column, subQuery) {
2402
- const c = this._columnPattern(String(column));
2403
2407
  this.$state.set('WHERE', [
2404
2408
  ...this.$state.get('WHERE'),
2405
2409
  [
2406
2410
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2407
- `${this.bindColumn(c)}`,
2411
+ `${this.bindColumn(String(column))}`,
2408
2412
  `${this.$constants('IN')}`,
2409
2413
  `(${subQuery})`
2410
2414
  ].join(' ')
@@ -2418,12 +2422,11 @@ class Model extends AbstractModel_1.AbstractModel {
2418
2422
  * @returns {this}
2419
2423
  */
2420
2424
  whereNotSubQuery(column, subQuery) {
2421
- const c = this._columnPattern(String(column));
2422
2425
  this.$state.set('WHERE', [
2423
2426
  ...this.$state.get('WHERE'),
2424
2427
  [
2425
2428
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2426
- `${this.bindColumn(c)}`,
2429
+ `${this.bindColumn(String(column))}`,
2427
2430
  `${this.$constants('NOT_IN')}`,
2428
2431
  `(${subQuery})`
2429
2432
  ].join(' ')
@@ -2437,14 +2440,13 @@ class Model extends AbstractModel_1.AbstractModel {
2437
2440
  * @returns {this}
2438
2441
  */
2439
2442
  orWhereSubQuery(column, subQuery) {
2440
- const c = this._columnPattern(String(column));
2441
2443
  this.$state.set('WHERE', [
2442
2444
  ...this.$state.get('WHERE'),
2443
2445
  [
2444
2446
  this.$state.get('WHERE').length
2445
2447
  ? `${this.$constants('OR')}`
2446
2448
  : '',
2447
- `${this.bindColumn(c)}`,
2449
+ `${this.bindColumn(String(column))}`,
2448
2450
  `${this.$constants('IN')}`,
2449
2451
  `(${subQuery})`
2450
2452
  ].join(' ')
@@ -2458,14 +2460,13 @@ class Model extends AbstractModel_1.AbstractModel {
2458
2460
  * @returns {this}
2459
2461
  */
2460
2462
  orWhereNotSubQuery(column, subQuery) {
2461
- const c = this._columnPattern(String(column));
2462
2463
  this.$state.set('WHERE', [
2463
2464
  ...this.$state.get('WHERE'),
2464
2465
  [
2465
2466
  this.$state.get('WHERE').length
2466
2467
  ? `${this.$constants('OR')}`
2467
2468
  : '',
2468
- `${this.bindColumn(c)}`,
2469
+ `${this.bindColumn(String(column))}`,
2469
2470
  `${this.$constants('NOT_IN')}`,
2470
2471
  `(${subQuery})`
2471
2472
  ].join(' ')
@@ -2482,13 +2483,12 @@ class Model extends AbstractModel_1.AbstractModel {
2482
2483
  if (!Array.isArray(array)) {
2483
2484
  throw this._assertError("This method must require the value to be an array only.");
2484
2485
  }
2485
- const c = this._columnPattern(String(column));
2486
2486
  if (!array.length) {
2487
2487
  this.$state.set('WHERE', [
2488
2488
  ...this.$state.get('WHERE'),
2489
2489
  [
2490
2490
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2491
- `${this.bindColumn(c)}`,
2491
+ `${this.bindColumn(String(column))}`,
2492
2492
  `${this.$constants('BETWEEN')}`,
2493
2493
  `${this.$constants(this.$constants('NULL'))}`,
2494
2494
  `${this.$constants('AND')}`,
@@ -2502,7 +2502,7 @@ class Model extends AbstractModel_1.AbstractModel {
2502
2502
  ...this.$state.get('WHERE'),
2503
2503
  [
2504
2504
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2505
- `${this.bindColumn(c)}`,
2505
+ `${this.bindColumn(String(column))}`,
2506
2506
  `${this.$constants('BETWEEN')}`,
2507
2507
  `${this._checkValueHasRaw(this.$utils.escape(value1))}`,
2508
2508
  `${this.$constants('AND')}`,
@@ -2521,13 +2521,12 @@ class Model extends AbstractModel_1.AbstractModel {
2521
2521
  if (!Array.isArray(array)) {
2522
2522
  throw this._assertError("This method must require the value to be an array only.");
2523
2523
  }
2524
- const c = this._columnPattern(String(column));
2525
2524
  if (!array.length) {
2526
2525
  this.$state.set('WHERE', [
2527
2526
  ...this.$state.get('WHERE'),
2528
2527
  [
2529
2528
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2530
- `${this.bindColumn(c)}`,
2529
+ `${this.bindColumn(String(column))}`,
2531
2530
  `${this.$constants('BETWEEN')}`,
2532
2531
  `${this.$constants(this.$constants('NULL'))}`,
2533
2532
  `${this.$constants('AND')}`,
@@ -2541,7 +2540,7 @@ class Model extends AbstractModel_1.AbstractModel {
2541
2540
  ...this.$state.get('WHERE'),
2542
2541
  [
2543
2542
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2544
- `${this.bindColumn(c)}`,
2543
+ `${this.bindColumn(String(column))}`,
2545
2544
  `${this.$constants('BETWEEN')}`,
2546
2545
  `${this._checkValueHasRaw(this.$utils.escape(value1))}`,
2547
2546
  `${this.$constants('AND')}`,
@@ -2560,13 +2559,12 @@ class Model extends AbstractModel_1.AbstractModel {
2560
2559
  if (!Array.isArray(array)) {
2561
2560
  throw this._assertError("This method must require the value to be an array only.");
2562
2561
  }
2563
- const c = this._columnPattern(String(column));
2564
2562
  if (!array.length) {
2565
2563
  this.$state.set('WHERE', [
2566
2564
  ...this.$state.get('WHERE'),
2567
2565
  [
2568
2566
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2569
- `${this.bindColumn(c)}`,
2567
+ `${this.bindColumn(String(column))}`,
2570
2568
  `${this.$constants('NOT_BETWEEN')}`,
2571
2569
  `${this.$constants(this.$constants('NULL'))}`,
2572
2570
  `${this.$constants('AND')}`,
@@ -2580,7 +2578,7 @@ class Model extends AbstractModel_1.AbstractModel {
2580
2578
  ...this.$state.get('WHERE'),
2581
2579
  [
2582
2580
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2583
- `${this.bindColumn(c)}`,
2581
+ `${this.bindColumn(String(column))}`,
2584
2582
  `${this.$constants('NOT_BETWEEN')}`,
2585
2583
  `${this._checkValueHasRaw(this.$utils.escape(value1))}`,
2586
2584
  `${this.$constants('AND')}`,
@@ -2599,13 +2597,12 @@ class Model extends AbstractModel_1.AbstractModel {
2599
2597
  if (!Array.isArray(array)) {
2600
2598
  throw this._assertError("This method must require the value to be an array only.");
2601
2599
  }
2602
- const c = this._columnPattern(String(column));
2603
2600
  if (!array.length) {
2604
2601
  this.$state.set('WHERE', [
2605
2602
  ...this.$state.get('WHERE'),
2606
2603
  [
2607
2604
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2608
- `${this.bindColumn(c)}`,
2605
+ `${this.bindColumn(String(column))}`,
2609
2606
  `${this.$constants('NOT_BETWEEN')}`,
2610
2607
  `${this.$constants(this.$constants('NULL'))}`,
2611
2608
  `${this.$constants('AND')}`,
@@ -2619,7 +2616,7 @@ class Model extends AbstractModel_1.AbstractModel {
2619
2616
  ...this.$state.get('WHERE'),
2620
2617
  [
2621
2618
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2622
- `${this.bindColumn(c)}`,
2619
+ `${this.bindColumn(String(column))}`,
2623
2620
  `${this.$constants('NOT_BETWEEN')}`,
2624
2621
  `${this._checkValueHasRaw(this.$utils.escape(value1))}`,
2625
2622
  `${this.$constants('AND')}`,
@@ -2634,12 +2631,11 @@ class Model extends AbstractModel_1.AbstractModel {
2634
2631
  * @returns {this}
2635
2632
  */
2636
2633
  whereNull(column) {
2637
- const c = this._columnPattern(String(column));
2638
2634
  this.$state.set('WHERE', [
2639
2635
  ...this.$state.get('WHERE'),
2640
2636
  [
2641
2637
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2642
- `${this.bindColumn(c)}`,
2638
+ `${this.bindColumn(String(column))}`,
2643
2639
  `${this.$constants('IS_NULL')}`
2644
2640
  ].join(' ')
2645
2641
  ]);
@@ -2651,12 +2647,11 @@ class Model extends AbstractModel_1.AbstractModel {
2651
2647
  * @returns {this}
2652
2648
  */
2653
2649
  orWhereNull(column) {
2654
- const c = this._columnPattern(String(column));
2655
2650
  this.$state.set('WHERE', [
2656
2651
  ...this.$state.get('WHERE'),
2657
2652
  [
2658
2653
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2659
- `${this.bindColumn(c)}`,
2654
+ `${this.bindColumn(String(column))}`,
2660
2655
  `${this.$constants('IS_NULL')}`
2661
2656
  ].join(' ')
2662
2657
  ]);
@@ -2668,12 +2663,11 @@ class Model extends AbstractModel_1.AbstractModel {
2668
2663
  * @returns {this}
2669
2664
  */
2670
2665
  whereNotNull(column) {
2671
- const c = this._columnPattern(String(column));
2672
2666
  this.$state.set('WHERE', [
2673
2667
  ...this.$state.get('WHERE'),
2674
2668
  [
2675
2669
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2676
- `${this.bindColumn(c)}`,
2670
+ `${this.bindColumn(String(column))}`,
2677
2671
  `${this.$constants('IS_NOT_NULL')}`
2678
2672
  ].join(' ')
2679
2673
  ]);
@@ -2685,12 +2679,11 @@ class Model extends AbstractModel_1.AbstractModel {
2685
2679
  * @returns {this}
2686
2680
  */
2687
2681
  orWhereNotNull(column) {
2688
- const c = this._columnPattern(String(column));
2689
2682
  this.$state.set('WHERE', [
2690
2683
  ...this.$state.get('WHERE'),
2691
2684
  [
2692
2685
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2693
- `${this.bindColumn(c)}`,
2686
+ `${this.bindColumn(String(column))}`,
2694
2687
  `${this.$constants('IS_NOT_NULL')}`
2695
2688
  ].join(' ')
2696
2689
  ]);
@@ -2705,7 +2698,6 @@ class Model extends AbstractModel_1.AbstractModel {
2705
2698
  */
2706
2699
  whereSensitive(column, operator, value) {
2707
2700
  [value, operator] = this._valueAndOperator(value, operator, arguments.length === 2);
2708
- const c = this._columnPattern(String(column));
2709
2701
  value = this.$utils.escape(value);
2710
2702
  value = this._valueTrueFalse(value);
2711
2703
  this.$state.set('WHERE', [
@@ -2713,7 +2705,7 @@ class Model extends AbstractModel_1.AbstractModel {
2713
2705
  [
2714
2706
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2715
2707
  `${this.$constants('BINARY')}`,
2716
- `${this.bindColumn(c)}`,
2708
+ `${this.bindColumn(String(column))}`,
2717
2709
  `${operator}`,
2718
2710
  `${this._checkValueHasRaw(this.$utils.escape(value))}`
2719
2711
  ].join(' ')
@@ -2729,7 +2721,6 @@ class Model extends AbstractModel_1.AbstractModel {
2729
2721
  */
2730
2722
  whereStrict(column, operator, value) {
2731
2723
  [value, operator] = this._valueAndOperator(value, operator, arguments.length === 2);
2732
- const c = this._columnPattern(String(column));
2733
2724
  value = this.$utils.escape(value);
2734
2725
  value = this._valueTrueFalse(value);
2735
2726
  this.$state.set('WHERE', [
@@ -2737,7 +2728,7 @@ class Model extends AbstractModel_1.AbstractModel {
2737
2728
  [
2738
2729
  this.$state.get('WHERE').length ? `${this.$constants('AND')}` : '',
2739
2730
  `${this.$constants('BINARY')}`,
2740
- `${this.bindColumn(c)}`,
2731
+ `${this.bindColumn(String(column))}`,
2741
2732
  `${operator}`,
2742
2733
  `${this._checkValueHasRaw(this.$utils.escape(value))}`
2743
2734
  ].join(' ')
@@ -2753,7 +2744,6 @@ class Model extends AbstractModel_1.AbstractModel {
2753
2744
  */
2754
2745
  orWhereSensitive(column, operator, value) {
2755
2746
  [value, operator] = this._valueAndOperator(value, operator, arguments.length === 2);
2756
- const c = this._columnPattern(String(column));
2757
2747
  value = this.$utils.escape(value);
2758
2748
  value = this._valueTrueFalse(value);
2759
2749
  this.$state.set('WHERE', [
@@ -2761,7 +2751,7 @@ class Model extends AbstractModel_1.AbstractModel {
2761
2751
  [
2762
2752
  this.$state.get('WHERE').length ? `${this.$constants('OR')}` : '',
2763
2753
  `${this.$constants('BINARY')}`,
2764
- `${this.bindColumn(c)}`,
2754
+ `${this.bindColumn(String(column))}`,
2765
2755
  `${operator}`,
2766
2756
  `${this._checkValueHasRaw(this.$utils.escape(value))}`
2767
2757
  ].join(' ')
@@ -2810,10 +2800,10 @@ class Model extends AbstractModel_1.AbstractModel {
2810
2800
  for (const index in columns) {
2811
2801
  const column = String(columns[index]);
2812
2802
  if (+index === 0) {
2813
- query.where(column, operator, value);
2803
+ query.where(this.bindColumn(column), operator, value);
2814
2804
  continue;
2815
2805
  }
2816
- query.orWhere(column, operator, value);
2806
+ query.orWhere(this.bindColumn(column), operator, value);
2817
2807
  }
2818
2808
  return query;
2819
2809
  });
@@ -2837,7 +2827,7 @@ class Model extends AbstractModel_1.AbstractModel {
2837
2827
  this.whereQuery((query) => {
2838
2828
  for (const key in columns) {
2839
2829
  const column = String(columns[key]);
2840
- query.where(column, operator, value);
2830
+ query.where(this.bindColumn(column), operator, value);
2841
2831
  }
2842
2832
  return query;
2843
2833
  });
@@ -3729,6 +3719,12 @@ class Model extends AbstractModel_1.AbstractModel {
3729
3719
  });
3730
3720
  }
3731
3721
  _valuePattern(column) {
3722
+ if (column.startsWith(this.$constants('FREEZE'))) {
3723
+ return `${column.replace(this.$constants('FREEZE'), '').replace(/`/g, '')}`;
3724
+ }
3725
+ if (column.startsWith(this.$constants('RAW'))) {
3726
+ return column.replace(this.$constants('RAW'), '').replace(/`/g, '');
3727
+ }
3732
3728
  switch (this.$state.get('PATTERN')) {
3733
3729
  case this.$constants('PATTERN').snake_case: {
3734
3730
  return column.replace(/([A-Z])/g, (str) => `_${str.toLowerCase()}`);
@@ -3765,12 +3761,6 @@ class Model extends AbstractModel_1.AbstractModel {
3765
3761
  return;
3766
3762
  });
3767
3763
  }
3768
- _columnPattern(column) {
3769
- if (column.startsWith(this.$constants('RAW'))) {
3770
- return column.replace(this.$constants('RAW'), '');
3771
- }
3772
- return this._valuePattern(column);
3773
- }
3774
3764
  _isPatternSnakeCase() {
3775
3765
  return this.$state.get('PATTERN') === this.$constants('PATTERN').snake_case;
3776
3766
  }