tspace-mysql 1.4.6 → 1.4.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.
@@ -3,54 +3,92 @@ import { Pagination, Backup, ConnectionOptions, BackupToFile, Connection, Connec
3
3
  declare class Builder extends AbstractBuilder {
4
4
  constructor();
5
5
  /**
6
+ * The 'distinct' method is used to apply the DISTINCT keyword to a database query.
6
7
  *
8
+ * It allows you to retrieve unique values from one or more columns in the result set, eliminating duplicate rows.
9
+ * @return {this} this
10
+ */
11
+ distinct(): this;
12
+ /**
13
+ * The 'select' method is used to specify which columns you want to retrieve from a database table.
14
+ *
15
+ * It allows you to choose the specific columns that should be included in the result set of a database query.
16
+ * @param {string[]} ...columns
17
+ * @return {this} this
18
+ */
19
+ select(...columns: string[]): this;
20
+ /**
21
+ * The 'selectRaw' method is used to specify which columns you want to retrieve from a database table.
22
+ *
23
+ * It allows you to choose the specific columns that should be included in the result set of a database query.
24
+ *
25
+ * This method allows you to specify raw-sql parameters for the query.
26
+ * @param {string[]} ...columns
27
+ * @return {this} this
28
+ */
29
+ selectRaw(...columns: string[]): this;
30
+ /**
31
+ * The 'selectObject' method is used to specify which columns you want to retrieve from a database table.
32
+ *
33
+ * It allows you to choose the specific columns that should be included in the result set to 'Object' of a database query.
34
+ * @param {string} object table name
35
+ * @param {string} alias as name of the column
36
+ * @return {this} this
37
+ */
38
+ selectObject(object: Record<string, string>, alias: string): this;
39
+ /**
40
+ * The 'pluck' method is used to retrieve the value of a single column from the first result of a query.
41
+ *
42
+ * It is often used when you need to retrieve a single value,
43
+ * such as an ID or a specific attribute, from a query result.
7
44
  * @param {string} column
8
45
  * @return {this}
9
46
  */
10
47
  pluck(column: string): this;
11
48
  /**
49
+ * The 'except' method is used to specify which columns you don't want to retrieve from a database table.
12
50
  *
51
+ * It allows you to choose the specific columns that should be not included in the result set of a database query.
13
52
  * @param {...string} columns
14
53
  * @return {this} this
15
54
  */
16
55
  except(...columns: string[]): this;
17
56
  /**
18
- * data alaways will return void
57
+ * The 'void' method is used to specify which you don't want to return a result from database table.
58
+ *
19
59
  * @return {this} this
20
60
  */
21
61
  void(): this;
22
62
  /**
63
+ * The 'only' method is used to specify which columns you don't want to retrieve from a result.
23
64
  *
65
+ * It allows you to choose the specific columns that should be not included in the result.
24
66
  * @param {...string} columns show only colums selected
25
67
  * @return {this} this
26
68
  */
27
69
  only(...columns: string[]): this;
28
70
  /**
71
+ * The 'chunk' method is used to process a large result set from a database query in smaller, manageable "chunks" or segments.
29
72
  *
30
- * @return {this} this
31
- */
32
- distinct(): this;
33
- /**
34
- * select data form table
35
- * @param {string[]} ...columns
36
- * @return {this} this
37
- */
38
- select(...columns: string[]): this;
39
- selectRaw(...columns: string[]): this;
40
- /**
41
- * chunks data from array
73
+ * It's particularly useful when you need to iterate over a large number of database records without loading all of them into memory at once.
74
+ *
75
+ * This helps prevent memory exhaustion and improves the performance of your application when dealing with large datasets.
42
76
  * @param {number} chunk
43
77
  * @return {this} this
44
78
  */
45
79
  chunk(chunk: number): this;
46
80
  /**
47
- *
81
+ * The 'when' method is used to specify if condition should be true will be next to the actions
48
82
  * @param {string | number | undefined | null | Boolean} condition when condition true will return query callback
49
83
  * @return {this} this
50
84
  */
51
85
  when(condition: string | number | undefined | null | Boolean, callback: Function): this;
52
86
  /**
53
- * if has 2 arguments default operator '='
87
+ * The 'where' method is used to add conditions to a database query.
88
+ *
89
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
90
+ *
91
+ * If has only 2 arguments default operator '='
54
92
  * @param {string} column if arguments is object
55
93
  * @param {string?} operator ['=', '<', '>' ,'!=', '!<', '!>' ,'LIKE']
56
94
  * @param {any?} value
@@ -58,28 +96,11 @@ declare class Builder extends AbstractBuilder {
58
96
  */
59
97
  where(column: string | any, operator?: any, value?: any): this;
60
98
  /**
61
- * where using object operator only '='
62
- * @param {Object} columns
63
- * @return {this}
64
- */
65
- whereObject(columns: Record<string, any>): this;
66
- /**
67
- * where json target to key in json values default operator '='
68
- * @param {string} column
69
- * @param {object} property
70
- * @property {string} property.targetKey
71
- * @property {string} property.value
72
- * @property {string?} property.operator
73
- * @example
74
- * @return {this}
75
- */
76
- whereJSON(column: string, { targetKey, value, operator }: {
77
- targetKey: string;
78
- value: string;
79
- operator?: string;
80
- }): this;
81
- /**
82
- * if has 2 arguments default operator '='
99
+ * The 'orWhere' method is used to add conditions to a database query.
100
+ *
101
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
102
+ *
103
+ * If has only 2 arguments default operator '='
83
104
  * @param {string} column
84
105
  * @param {string?} operator ['=', '<', '>' ,'!=', '!<', '!>' ,'LIKE']
85
106
  * @param {any?} value
@@ -87,20 +108,70 @@ declare class Builder extends AbstractBuilder {
87
108
  */
88
109
  orWhere(column: string, operator?: any, value?: any): this;
89
110
  /**
111
+ * The 'whereRaw' method is used to add a raw SQL condition to a database query.
90
112
  *
113
+ * It allows you to include custom SQL expressions as conditions in your query,
114
+ * which can be useful for situations where you need to perform complex or custom filtering that cannot be achieved using Laravel's standard query builder methods.
91
115
  * @param {string} sql where column with raw sql
92
116
  * @return {this} this
93
117
  */
94
118
  whereRaw(sql: string): this;
95
119
  /**
120
+ * The 'orWhereRaw' method is used to add a raw SQL condition to a database query.
96
121
  *
97
- * @param {string} query where column with raw sql
122
+ * It allows you to include custom SQL expressions as conditions in your query,
123
+ * which can be useful for situations where you need to perform complex or custom filtering that cannot be achieved using Laravel's standard query builder methods.
124
+ * @param {string} sql where column with raw sql
98
125
  * @return {this} this
99
126
  */
100
127
  orWhereRaw(sql: string): this;
101
128
  /**
129
+ * The 'whereObject' method is used to add conditions to a database query.
130
+ *
131
+ * It allows you to specify conditions in object that records in the database must meet in order to be included in the result set.
132
+ *
133
+ * This method is defalut operator '=' only
134
+ * @param {Object} columns
135
+ * @return {this}
136
+ */
137
+ whereObject(columns: Record<string, any>): this;
138
+ /**
139
+ * The 'whereJSON' method is used to add conditions to a database query.
140
+ *
141
+ * It allows you to specify conditions in that records json in the database must meet in order to be included in the result set.
142
+ * @param {string} column
143
+ * @param {object} property object { key , value , operator }
144
+ * @property {string} property.key
145
+ * @property {string} property.value
146
+ * @property {string?} property.operator
147
+ * @return {this}
148
+ */
149
+ whereJSON(column: string, { key, value, operator }: {
150
+ key: string;
151
+ value: string;
152
+ operator?: string;
153
+ }): this;
154
+ /**
155
+ * The 'whereJSON' method is used to add conditions to a database query.
156
+ *
157
+ * It allows you to specify conditions in that records json in the database must meet in order to be included in the result set.
158
+ * @param {string} column
159
+ * @param {object} property object { key , value , operator }
160
+ * @property {string} property.key
161
+ * @property {string} property.value
162
+ * @property {string?} property.operator
163
+ * @return {this}
164
+ */
165
+ whereJson(column: string, { key, value, operator }: {
166
+ key: string;
167
+ value: string;
168
+ operator?: string;
169
+ }): this;
170
+ /**
171
+ *
172
+ * The 'whereExists' method is used to add a conditional clause to a database query that checks for the existence of related records in a subquery or another table.
102
173
  *
103
- * where exists
174
+ * It allows you to filter records based on whether a specified condition is true for related records.
104
175
  * @param {string} sql
105
176
  * @return {this}
106
177
  */
@@ -125,115 +196,159 @@ declare class Builder extends AbstractBuilder {
125
196
  */
126
197
  whereUser(userId: number, column?: string): this;
127
198
  /**
128
- * using array value where in value in array
199
+ * The 'whereIn' method is used to add a conditional clause to a database query that checks if a specified column's value is included in a given array of values.
200
+ *
201
+ * This method is useful when you want to filter records based on a column matching any of the values provided in an array.
129
202
  * @param {string} column
130
203
  * @param {array} array
131
204
  * @return {this}
132
205
  */
133
206
  whereIn(column: string, array: any[]): this;
134
207
  /**
135
- * or where in data using array values
208
+ * The 'orWhereIn' method is used to add a conditional clause to a database query that checks if a specified column's value is included in a given array of values.
209
+ *
210
+ * This method is useful when you want to filter records based on a column matching any of the values provided in an array.
136
211
  * @param {string} column
137
212
  * @param {array} array
138
213
  * @return {this}
139
214
  */
140
215
  orWhereIn(column: string, array: any[]): this;
141
216
  /**
142
- * where not in data using array values
217
+ * The 'whereNotIn' method is used to add a conditional clause to a database query that checks if a specified column's value is not included in a given array of values.
218
+ *
219
+ * This method is the opposite of whereIn and is useful when you want to filter records based on a column not matching any of the values provided in an array.
143
220
  * @param {string} column
144
221
  * @param {array} array
145
222
  * @return {this}
146
223
  */
147
224
  whereNotIn(column: string, array: any[]): this;
148
225
  /**
149
- * where not in data using array values
226
+ * The 'orWhereNotIn' method is used to add a conditional clause to a database query that checks if a specified column's value is not included in a given array of values.
227
+ *
228
+ * This method is the opposite of whereIn and is useful when you want to filter records based on a column not matching any of the values provided in an array.
150
229
  * @param {string} column
151
230
  * @param {array} array
152
231
  * @return {this}
153
232
  */
154
233
  orWhereNotIn(column: string, array: any[]): this;
155
234
  /**
156
- * where sub query using sub query sql
235
+ * The 'whereSubQuery' method is used to add a conditional clause to a database query that involves a subquery.
236
+ *
237
+ * Subqueries also known as nested queries, are queries that are embedded within the main query.
238
+ *
239
+ * They are often used when you need to perform a query to retrieve some values and then use those values as part of the condition in the main query.
157
240
  * @param {string} column
158
241
  * @param {string} subQuery
159
242
  * @return {this}
160
243
  */
161
244
  whereSubQuery(column: string, subQuery: string): this;
162
245
  /**
163
- * where not sub query using sub query sql
246
+ * The 'whereNotSubQuery' method is used to add a conditional clause to a database query that involves a subquery.
247
+ *
248
+ * Subqueries also known as nested queries, are queries that are embedded within the main query.
249
+ *
250
+ * They are often used when you need to perform a query to retrieve not some values and then use those values as part of the condition in the main query.
164
251
  * @param {string} column
165
252
  * @param {string} subQuery
166
253
  * @return {this}
167
254
  */
168
255
  whereNotSubQuery(column: string, subQuery: string): this;
169
256
  /**
170
- * or where not sub query using query sql
257
+ * The 'orWhereSubQuery' method is used to add a conditional clause to a database query that involves a subquery.
258
+ *
259
+ * Subqueries also known as nested queries, are queries that are embedded within the main query.
260
+ *
261
+ * They are often used when you need to perform a query to retrieve some values and then use those values as part of the condition in the main query.
171
262
  * @param {string} column
172
263
  * @param {string} subQuery
173
264
  * @return {this}
174
265
  */
175
266
  orWhereSubQuery(column: string, subQuery: string): this;
176
267
  /**
177
- * or where not sub query using query sql
268
+ * The 'orWhereNotSubQuery' method is used to add a conditional clause to a database query that involves a subquery.
269
+ *
270
+ * Subqueries also known as nested queries, are queries that are embedded within the main query.
271
+ *
272
+ * They are often used when you need to perform a query to retrieve not some values and then use those values as part of the condition in the main query.
178
273
  * @param {string} column
179
274
  * @param {string} subQuery
180
275
  * @return {this}
181
276
  */
182
277
  orWhereNotSubQuery(column: string, subQuery: string): this;
183
278
  /**
184
- * where between using [value1, value2]
279
+ * The 'whereBetween' method is used to add a conditional clause to a database query that checks if a specified column's value falls within a specified range of values.
280
+ *
281
+ * This method is useful when you want to filter records based on a column's value being within a certain numeric or date range.
185
282
  * @param {string} column
186
283
  * @param {array} array
187
284
  * @return {this}
188
285
  */
189
286
  whereBetween(column: string, array: any[]): this;
190
287
  /**
191
- * where between using [value1, value2]
288
+ * The 'orWhereBetween' method is used to add a conditional clause to a database query that checks if a specified column's value falls within a specified range of values.
289
+ *
290
+ * This method is useful when you want to filter records based on a column's value being within a certain numeric or date range.
192
291
  * @param {string} column
193
292
  * @param {array} array
194
293
  * @return {this}
195
294
  */
196
295
  orWhereBetween(column: string, array: any[]): this;
197
296
  /**
198
- * where not between using [value1, value2]
297
+ * The 'whereNotBetween' method is used to add a conditional clause to a database query that checks if a specified column's value falls within a specified range of values.
298
+ *
299
+ * This method is useful when you want to filter records based on a column's value does not fall within a specified range of values.
199
300
  * @param {string} column
200
301
  * @param {array} array
201
302
  * @return {this}
202
303
  */
203
304
  whereNotBetween(column: string, array: any[]): this;
204
305
  /**
205
- * where not between using [value1, value2]
306
+ * The 'orWhereNotBetween' method is used to add a conditional clause to a database query that checks if a specified column's value falls within a specified range of values.
307
+ *
308
+ * This method is useful when you want to filter records based on a column's value does not fall within a specified range of values.
206
309
  * @param {string} column
207
310
  * @param {array} array
208
311
  * @return {this}
209
312
  */
210
313
  orWhereNotBetween(column: string, array: any[]): this;
211
314
  /**
212
- * where null using NULL
315
+ * The 'whereNull' method is used to add a conditional clause to a database query that checks if a specified column's value is NULL.
316
+ *
317
+ * This method is helpful when you want to filter records based on whether a particular column has a NULL value.
213
318
  * @param {string} column
214
319
  * @return {this}
215
320
  */
216
321
  whereNull(column: string): this;
217
322
  /**
218
- * where null using NULL
219
- * @param {string} column
220
- * @return {this}
221
- */
323
+ * The 'orWhereNull' method is used to add a conditional clause to a database query that checks if a specified column's value is NULL.
324
+ *
325
+ * This method is helpful when you want to filter records based on whether a particular column has a NULL value.
326
+ * @param {string} column
327
+ * @return {this}
328
+ */
222
329
  orWhereNull(column: string): this;
223
330
  /**
224
- * where not null using NULL
331
+ * The 'whereNotNull' method is used to add a conditional clause to a database query that checks if a specified column's value is not NULL.
332
+ *
333
+ * This method is useful when you want to filter records based on whether a particular column has a non-null value.
225
334
  * @param {string} column
226
335
  * @return {this}
227
336
  */
228
337
  whereNotNull(column: string): this;
229
338
  /**
230
- * where not null using NULL
339
+ * The 'orWhereNotNull' method is used to add a conditional clause to a database query that checks if a specified column's value is not NULL.
340
+ *
341
+ * This method is useful when you want to filter records based on whether a particular column has a non-null value.
231
342
  * @param {string} column
232
343
  * @return {this}
233
344
  */
234
345
  orWhereNotNull(column: string): this;
235
346
  /**
236
- * where sensitive (uppercase, lowercase)
347
+ * The 'whereSensitive' method is used to add conditions to a database query.
348
+ *
349
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
350
+ *
351
+ * The where method is need to perform a case-sensitive comparison in a query.
237
352
  * @param {string} column
238
353
  * @param {string?} operator = < > != !< !>
239
354
  * @param {any?} value
@@ -241,7 +356,11 @@ declare class Builder extends AbstractBuilder {
241
356
  */
242
357
  whereSensitive(column: string, operator?: any, value?: any): this;
243
358
  /**
244
- * where Strict (uppercase, lowercase)
359
+ * The 'whereStrict' method is used to add conditions to a database query.
360
+ *
361
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
362
+ *
363
+ * The where method is need to perform a case-sensitive comparison in a query.
245
364
  * @param {string} column
246
365
  * @param {string?} operator = < > != !< !>
247
366
  * @param {any?} value
@@ -249,7 +368,11 @@ declare class Builder extends AbstractBuilder {
249
368
  */
250
369
  whereStrict(column: string, operator?: any, value?: any): this;
251
370
  /**
252
- * or where sensitive (uppercase, lowercase)
371
+ * The 'orWhereSensitive' method is used to add conditions to a database query.
372
+ *
373
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
374
+ *
375
+ * The where method is need to perform a case-sensitive comparison in a query.
253
376
  * @param {string} column
254
377
  * @param {string?} operator = < > != !< !>
255
378
  * @param {any?} value
@@ -257,23 +380,55 @@ declare class Builder extends AbstractBuilder {
257
380
  */
258
381
  orWhereSensitive(column: string, operator?: any, value?: any): this;
259
382
  /**
260
- * where group query
261
- * @param {function} callback callback query
383
+ * The 'whereQuery' method is used to add conditions to a database query to create a grouped condition.
384
+ *
385
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
386
+ * @param {Function} callback callback query
262
387
  * @return {this}
263
388
  */
264
389
  whereQuery(callback: Function): this;
265
390
  /**
266
- * where group query
391
+ * The 'whereGroup' method is used to add conditions to a database query to create a grouped condition.
392
+ *
393
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
267
394
  * @param {function} callback callback query
268
395
  * @return {this}
269
396
  */
270
397
  whereGroup(callback: Function): this;
271
398
  /**
272
- * where group query
399
+ * The 'orWhereQuery' method is used to add conditions to a database query to create a grouped condition.
400
+ *
401
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
273
402
  * @param {function} callback callback query
274
403
  * @return {this}
275
404
  */
276
405
  orWhereQuery(callback: Function): this;
406
+ /**
407
+ * The 'whereCases' method is used to add conditions with cases to a database query.
408
+ *
409
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
410
+ *
411
+ * @param {Array<{when , then}>} cases used to add conditions when and then
412
+ * @param {string?} elseCase else when end of conditions
413
+ * @return {this}
414
+ */
415
+ whereCases(cases: {
416
+ when: string;
417
+ then: string;
418
+ }[], elseCase?: string): this;
419
+ /**
420
+ * The 'orWhereCases' method is used to add conditions with cases to a database query.
421
+ *
422
+ * It allows you to specify conditions that records in the database must meet in order to be included in the result set.
423
+ *
424
+ * @param {Array<{when , then}>} cases used to add conditions when and then
425
+ * @param {string?} elseCase else when end of conditions
426
+ * @return {this}
427
+ */
428
+ orWhereCases(cases: {
429
+ when: string;
430
+ then: string;
431
+ }[], elseCase?: string): this;
277
432
  /**
278
433
  * select by cases
279
434
  * @param {array} cases array object [{ when : 'id < 7' , then : 'id is than under 7'}]
@@ -285,7 +440,9 @@ declare class Builder extends AbstractBuilder {
285
440
  then: string;
286
441
  }[], as: string): this;
287
442
  /**
443
+ * The 'join' method is used to perform various types of SQL joins between two or more database tables.
288
444
  *
445
+ * Joins are used to combine data from different tables based on a specified condition, allowing you to retrieve data from related tables in a single query.
289
446
  * @param {string} localKey local key in current table
290
447
  * @param {string} referenceKey reference key in next table
291
448
  * @example
@@ -300,218 +457,283 @@ declare class Builder extends AbstractBuilder {
300
457
  */
301
458
  join(localKey: string, referenceKey: string): this;
302
459
  /**
460
+ * The 'rightJoin' method is used to perform a right join operation between two database tables.
461
+ *
462
+ * A right join, also known as a right outer join, retrieves all rows from the right table and the matching rows from the left table.
303
463
  *
464
+ * If there is no match in the left table, NULL values are returned for columns from the left table
304
465
  * @param {string} localKey local key in current table
305
466
  * @param {string} referenceKey reference key in next table
306
467
  * @return {this}
307
468
  */
308
469
  rightJoin(localKey: string, referenceKey: string): this;
309
470
  /**
471
+ * The 'leftJoin' method is used to perform a left join operation between two database tables.
310
472
  *
473
+ * A left join retrieves all rows from the left table and the matching rows from the right table.
474
+ *
475
+ * If there is no match in the right table, NULL values are returned for columns from the right table.
311
476
  * @param {string} localKey local key in current table
312
477
  * @param {string} referenceKey reference key in next table
313
478
  * @return {this}
314
479
  */
315
480
  leftJoin(localKey: string, referenceKey: string): this;
316
481
  /**
482
+ * The 'crossJoin' method performs a cross join operation between two or more tables.
317
483
  *
484
+ * A cross join, also known as a Cartesian join, combines every row from the first table with every row from the second table.
318
485
  * @param {string} localKey local key in current table
319
486
  * @param {string} referenceKey reference key in next table
320
487
  * @return {this}
321
488
  */
322
489
  crossJoin(localKey: string, referenceKey: string): this;
323
490
  /**
324
- * sort the result in ASC or DESC order.
491
+ * The 'orderBy' method is used to specify the order in which the results of a database query should be sorted.
492
+ *
493
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction (ascending or descending) for each column.
325
494
  * @param {string} column
326
- * @param {string?} order [order=asc] asc, desc
495
+ * @param {string?} order by default order = 'asc' but you can used 'asc' or 'desc'
327
496
  * @return {this}
328
497
  */
329
498
  orderBy(column: string, order?: string): this;
330
499
  /**
331
- * sort the result in ASC or DESC order. can using with raw query
500
+ * The 'orderByRaw' method is used to specify the order in which the results of a database query should be sorted.
501
+ *
502
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction (ascending or descending) for each column.
503
+ *
504
+ * This method allows you to specify raw-sql parameters for the query.
332
505
  * @param {string} column
333
506
  * @param {string?} order [order=asc] asc, desc
334
507
  * @return {this}
335
508
  */
336
509
  orderByRaw(column: string, order?: string): this;
337
510
  /**
338
- * sort the result in using DESC for order by.
511
+ * The 'latest' method is used to specify the order in which the results of a database query should be sorted.
512
+ *
513
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction descending for each column.
339
514
  * @param {string?} columns [column=id]
340
515
  * @return {this}
341
516
  */
342
517
  latest(...columns: string[]): this;
343
518
  /**
344
- * sort the result in using DESC for order by. can using with raw query
519
+ * The 'latestRaw' method is used to specify the order in which the results of a database query should be sorted.
520
+ *
521
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction descending for each column.
522
+ *
523
+ * This method allows you to specify raw-sql parameters for the query.
345
524
  * @param {string?} columns [column=id]
346
525
  * @return {this}
347
526
  */
348
527
  latestRaw(...columns: string[]): this;
349
528
  /**
350
- * sort the result in using ASC for order by.
529
+ * The 'oldest' method is used to specify the order in which the results of a database query should be sorted.
530
+ *
531
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction ascending for each column.
351
532
  * @param {string?} columns [column=id]
352
533
  * @return {this}
353
534
  */
354
535
  oldest(...columns: string[]): this;
355
536
  /**
356
- * sort the result in using ASC for order by. can using with raw query
537
+ * The 'oldestRaw' method is used to specify the order in which the results of a database query should be sorted.
538
+ *
539
+ * This method allows you to specify one or more columns by which the result set should be ordered, as well as the sorting direction ascending for each column.
540
+ *
541
+ * This method allows you to specify raw-sql parameters for the query.
357
542
  * @param {string?} columns [column=id]
358
543
  * @return {this}
359
544
  */
360
545
  oldestRaw(...columns: string[]): this;
361
546
  /**
547
+ * The groupBy method is used to group the results of a database query by one or more columns.
362
548
  *
549
+ * It allows you to aggregate data based on the values in specified columns, often in conjunction with aggregate functions like COUNT, SUM, AVG, and MAX.
550
+ *
551
+ * Grouping is commonly used for generating summary reports, calculating totals, and performing other aggregate operations on data.
363
552
  * @param {string?} columns [column=id]
364
553
  * @return {this}
365
554
  */
366
555
  groupBy(...columns: string[]): this;
367
556
  /**
368
- *
369
- * @param {string?} columns [column=id]
370
- * @return {this}
371
- */
557
+ * The groupBy method is used to group the results of a database query by one or more columns.
558
+ *
559
+ * It allows you to aggregate data based on the values in specified columns, often in conjunction with aggregate functions like COUNT, SUM, AVG, and MAX.
560
+ *
561
+ * Grouping is commonly used for generating summary reports, calculating totals, and performing other aggregate operations on data.
562
+ *
563
+ * This method allows you to specify raw-sql parameters for the query.
564
+ * @param {string?} columns [column=id]
565
+ * @return {this}
566
+ */
372
567
  groupByRaw(...columns: string[]): this;
373
568
  /**
569
+ * The 'having' method is used to add a conditional clause to a database query that filters the result set after the GROUP BY operation has been applied.
374
570
  *
571
+ * It is typically used in conjunction with the GROUP BY clause to filter aggregated data based on some condition.
572
+ *
573
+ * The having clause allows you to apply conditions to aggregated values, such as the result of COUNT, SUM, AVG, or other aggregate functions.
375
574
  * @param {string} condition
376
575
  * @return {this}
377
576
  */
378
577
  having(condition: string): this;
379
578
  /**
579
+ * The 'havingRaw' method is used to add a conditional clause to a database query that filters the result set after the GROUP BY operation has been applied.
580
+ *
581
+ * It is typically used in conjunction with the GROUP BY clause to filter aggregated data based on some condition.
582
+ *
583
+ * The having clause allows you to apply conditions to aggregated values, such as the result of COUNT, SUM, AVG, or other aggregate functions.
380
584
  *
585
+ * This method allows you to specify raw-sql parameters for the query.
381
586
  * @param {string} condition
382
587
  * @return {this}
383
588
  */
384
589
  havingRaw(condition: string): this;
385
590
  /**
386
- * sort the result in random order.
591
+ * The 'random' method is used to add a random ordering to a database query.
592
+ *
593
+ * This method is used to retrieve random records from a database table or to randomize the order in which records are returned in the query result set.
387
594
  * @return {this}
388
595
  */
389
596
  random(): this;
390
597
  /**
391
- * sort the result in random order.
598
+ * The 'inRandom' method is used to add a random ordering to a database query.
599
+ *
600
+ * This method is used to retrieve random records from a database table or to randomize the order in which records are returned in the query result set.
392
601
  * @return {this}
393
602
  */
394
603
  inRandom(): this;
395
604
  /**
396
- * limit data
605
+ * The 'limit' method is used to limit the number of records returned by a database query.
606
+ *
607
+ * It allows you to specify the maximum number of rows to retrieve from the database table.
397
608
  * @param {number=} number [number=1]
398
609
  * @return {this}
399
610
  */
400
611
  limit(number?: number): this;
401
612
  /**
402
- * limit data
613
+ * The 'limit' method is used to limit the number of records returned by a database query.
614
+ *
615
+ * It allows you to specify the maximum number of rows to retrieve from the database table.
403
616
  * @param {number=} number [number=1]
404
617
  * @return {this}
405
618
  */
406
619
  take(number?: number): this;
407
620
  /**
621
+ * The offset method is used to specify the number of records to skip from the beginning of a result set.
408
622
  *
623
+ * It is often used in combination with the limit method for pagination or to skip a certain number of records when retrieving data from a database table.
409
624
  * @param {number=} number [number=1]
410
625
  * @return {this}
411
626
  */
412
627
  offset(number?: number): this;
413
628
  /**
629
+ * The offset method is used to specify the number of records to skip from the beginning of a result set.
414
630
  *
631
+ * It is often used in combination with the limit method for pagination or to skip a certain number of records when retrieving data from a database table.
415
632
  * @param {number=} number [number=1]
416
633
  * @return {this}
417
634
  */
418
635
  skip(number?: number): this;
419
636
  /**
420
- *
637
+ * The 'hidden' method is used to specify which columns you want to hidden result.
638
+ * It allows you to choose the specific columns that should be hidden in the result.
421
639
  * @param {...string} columns
422
640
  * @return {this} this
423
641
  */
424
642
  hidden(...columns: string[]): this;
425
643
  /**
644
+ * The 'update' method is used to update existing records in a database table that are associated.
426
645
  *
427
- * update data in the database
646
+ * It simplifies the process of updating records by allowing you to specify the values to be updated using a single call.
647
+ *
648
+ * It allows you to remove one record that match certain criteria.
428
649
  * @param {object} data
429
650
  * @param {array?} updateNotExists options for except update some records in your ${data} using name column(s)
430
651
  * @return {this} this
431
652
  */
432
653
  update(data: Record<string, any>, updateNotExists?: string[]): this;
433
654
  /**
655
+ * The 'updateMany' method is used to update existing records in a database table that are associated.
656
+ *
657
+ * It simplifies the process of updating records by allowing you to specify the values to be updated using a single call.
434
658
  *
435
- * update record if data is empty in the database
659
+ * It allows you to remove more records that match certain criteria.
660
+ * @param {object} data
661
+ * @param {array?} updateNotExists options for except update some records in your ${data} using name column(s)
662
+ * @return {this} this
663
+ */
664
+ updateMany(data: Record<string, any>, updateNotExists?: string[]): this;
665
+ /**
666
+ * The 'updateNotExists' method is used to update existing records in a database table that are associated.
667
+ *
668
+ * It simplifies the process of updating records by allowing you to specify the values to be updated using a single call.
669
+ *
670
+ * It method will be update record if data is empty or null in the column values
436
671
  * @param {object} data
437
672
  * @return {this} this
438
673
  */
439
674
  updateNotExists(data: Record<string, any>): this;
440
675
  /**
676
+ * The 'insert' method is used to insert a new record into a database table associated.
441
677
  *
442
- * insert data into the database
678
+ * It simplifies the process of creating and inserting records.
443
679
  * @param {object} data
444
680
  * @return {this} this
445
681
  */
446
682
  insert(data: Record<string, any>): this;
447
683
  /**
684
+ * The 'create' method is used to insert a new record into a database table associated.
448
685
  *
449
- * insert data into the database
686
+ * It simplifies the process of creating and inserting records.
450
687
  * @param {object} data
451
688
  * @return {this} this
452
689
  */
453
690
  create(data: Record<string, any>): this;
454
691
  /**
692
+ * The 'createMultiple' method is used to insert a new records into a database table associated.
455
693
  *
456
- * insert muliple data into the database
694
+ * It simplifies the process of creating and inserting records with an array.
457
695
  * @param {array} data create multiple data
458
696
  * @return {this} this this
459
697
  */
460
698
  createMultiple(data: Array<Record<string, any>>): this;
461
699
  /**
700
+ * The 'createMany' method is used to insert a new records into a database table associated.
462
701
  *
463
- * insert muliple data into the database
702
+ * It simplifies the process of creating and inserting records with an array.
464
703
  * @param {array} data create multiple data
465
704
  * @return {this} this this
466
705
  */
467
- insertMultiple(data: Array<Record<string, any>>): this;
468
- /**
469
- *
470
- * @return {string} return sql query
471
- */
472
- toString(): string;
473
- /**
474
- *
475
- * @return {string} return sql query
476
- */
477
- toSQL(): string;
706
+ createMany(data: Array<Record<string, any>>): this;
478
707
  /**
708
+ * The 'insertMultiple' method is used to insert a new records into a database table associated.
479
709
  *
480
- * @return {string}
481
- */
482
- toRawSQL(): string;
483
- /**
484
- *
485
- * @param {boolean} debug debug sql statements
710
+ * It simplifies the process of creating and inserting records with an array.
711
+ * @param {array} data create multiple data
486
712
  * @return {this} this this
487
713
  */
488
- debug(debug?: boolean): this;
714
+ insertMultiple(data: Array<Record<string, any>>): this;
489
715
  /**
716
+ * The 'insertMany' method is used to insert a new records into a database table associated.
490
717
  *
491
- * @param {boolean} debug debug sql statements
718
+ * It simplifies the process of creating and inserting records with an array.
719
+ * @param {array} data create multiple data
492
720
  * @return {this} this this
493
721
  */
494
- dd(debug?: boolean): this;
495
- /**
496
- * hook function when execute returned result to callback function
497
- * @param {Function} func function for callback result
498
- * @return {this}
499
- */
500
- hook(func: Function): this;
501
- /**
502
- * hook function when execute returned result to callback function
503
- * @param {Function} func function for callback result
504
- * @return {this}
505
- */
506
- before(func: Function): this;
722
+ insertMany(data: Array<Record<string, any>>): this;
507
723
  /**
724
+ * The 'createNotExists' method to insert data into a database table while ignoring any duplicate key constraint violations.
508
725
  *
726
+ * This method is particularly useful when you want to insert records into a table and ensure that duplicates are not inserted,
727
+ * but without raising an error or exception if duplicates are encountered.
509
728
  * @param {object} data create not exists data
510
729
  * @return {this} this this
511
730
  */
512
731
  createNotExists(data: Record<string, any>): this;
513
732
  /**
733
+ * The 'insertNotExists' method to insert data into a database table while ignoring any duplicate key constraint violations.
514
734
  *
735
+ * This method is particularly useful when you want to insert records into a table and ensure that duplicates are not inserted,
736
+ * but without raising an error or exception if duplicates are encountered.
515
737
  * @param {object} data insert not exists data
516
738
  * @return {this} this this
517
739
  */
@@ -519,8 +741,10 @@ declare class Builder extends AbstractBuilder {
519
741
  length?: never;
520
742
  }): this;
521
743
  /**
744
+ * The 'createOrSelect' method to insert data into a database table while select any duplicate key constraint violations.
522
745
  *
523
- * check data if exists if exists then return result. if not exists insert data
746
+ * This method is particularly useful when you want to insert records into a table and ensure that duplicates are not inserted,
747
+ * but if exists should be returns a result.
524
748
  * @param {object} data insert data
525
749
  * @return {this} this this
526
750
  */
@@ -528,8 +752,10 @@ declare class Builder extends AbstractBuilder {
528
752
  length?: never;
529
753
  }): this;
530
754
  /**
755
+ * The 'insertOrSelect' method to insert data into a database table while select any duplicate key constraint violations.
531
756
  *
532
- * check data if exists if exists then update. if not exists insert
757
+ * This method is particularly useful when you want to insert records into a table and ensure that duplicates are not inserted,
758
+ * but if exists should be returns a result.
533
759
  * @param {object} data insert or update data
534
760
  * @return {this} this this
535
761
  */
@@ -537,8 +763,10 @@ declare class Builder extends AbstractBuilder {
537
763
  length?: never;
538
764
  }): this;
539
765
  /**
766
+ * The 'updateOrCreate' method allows you to update an existing record in a database table if it exists or create a new record if it does not exist.
540
767
  *
541
- * check data if exists if exists then update. if not exists insert
768
+ * This method is particularly useful when you want to update a record based on certain conditions and,
769
+ * if the record matching those conditions doesn't exist, create a new one with the provided data.
542
770
  * @param {object} data insert or update data
543
771
  * @return {this} this this
544
772
  */
@@ -546,8 +774,10 @@ declare class Builder extends AbstractBuilder {
546
774
  length?: never;
547
775
  }): this;
548
776
  /**
777
+ * The 'updateOrInsert' method allows you to update an existing record in a database table if it exists or create a new record if it does not exist.
549
778
  *
550
- * check data if exists if exists then update. if not exists insert
779
+ * This method is particularly useful when you want to update a record based on certain conditions and,
780
+ * if the record matching those conditions doesn't exist, create a new one with the provided data.
551
781
  * @param {object} data insert or update data
552
782
  * @return {this} this this
553
783
  */
@@ -555,8 +785,10 @@ declare class Builder extends AbstractBuilder {
555
785
  length?: never;
556
786
  }): this;
557
787
  /**
788
+ * The 'insertOrUpdate' method allows you to update an existing record in a database table if it exists or create a new record if it does not exist.
558
789
  *
559
- * check data if exists if exists then update. if not exists insert
790
+ * This method is particularly useful when you want to update a record based on certain conditions and,
791
+ * if the record matching those conditions doesn't exist, create a new one with the provided data.
560
792
  * @param {object} data insert or update data
561
793
  * @return {this} this this
562
794
  */
@@ -565,13 +797,71 @@ declare class Builder extends AbstractBuilder {
565
797
  }): this;
566
798
  /**
567
799
  *
568
- * check data if exists if exists then update. if not exists insert
800
+ * The 'createOrUpdate' method allows you to update an existing record in a database table if it exists or create a new record if it does not exist.
801
+ *
802
+ * This method is particularly useful when you want to update a record based on certain conditions and,
803
+ * if the record matching those conditions doesn't exist, create a new one with the provided data.
569
804
  * @param {object} data create or update data
570
805
  * @return {this} this this
571
806
  */
572
807
  createOrUpdate(data: Record<string, any> & {
573
808
  length?: never;
574
809
  }): this;
810
+ /**
811
+ * The 'toString' method is used to retrieve the raw SQL query that would be executed by a query builder instance without actually executing it.
812
+ *
813
+ * This method is particularly useful for debugging and understanding the SQL queries generated by your application.
814
+ * @return {string} return sql query
815
+ */
816
+ toString(): string;
817
+ /**
818
+ * The 'toSQL' method is used to retrieve the raw SQL query that would be executed by a query builder instance without actually executing it.
819
+ *
820
+ * This method is particularly useful for debugging and understanding the SQL queries generated by your application.
821
+ * @return {string} return sql query
822
+ */
823
+ toSQL(): string;
824
+ /**
825
+ * The 'toRawSQL' method is used to retrieve the raw SQL query that would be executed by a query builder instance without actually executing it.
826
+ *
827
+ * This method is particularly useful for debugging and understanding the SQL queries generated by your application.
828
+ * @return {string}
829
+ */
830
+ toRawSQL(): string;
831
+ /**
832
+ *
833
+ * @return {string} return table name
834
+ */
835
+ getTableName(): string;
836
+ /**
837
+ *
838
+ * @return {string} return table.column
839
+ */
840
+ bindColumn(column: string): string;
841
+ /**
842
+ * The 'debug' method is used to console.log raw SQL query that would be executed by a query builder
843
+ * @param {boolean} debug debug sql statements
844
+ * @return {this} this this
845
+ */
846
+ debug(debug?: boolean): this;
847
+ /**
848
+ * The 'dd' method is used to console.log raw SQL query that would be executed by a query builder
849
+ * @param {boolean} debug debug sql statements
850
+ * @return {this} this this
851
+ */
852
+ dd(debug?: boolean): this;
853
+ /**
854
+ * The 'hook' method is used function when execute returns a result to callback function
855
+ * @param {Function} func function for callback result
856
+ * @return {this}
857
+ */
858
+ hook(func: Function): this;
859
+ /**
860
+ * The 'before' method is used function when execute returns a result to callback function
861
+ * @param {Function} func function for callback result
862
+ * @return {this}
863
+ */
864
+ before(func: Function): this;
575
865
  /**
576
866
  *
577
867
  * @param {Object} options options for connection database with credentials
@@ -602,29 +892,19 @@ declare class Builder extends AbstractBuilder {
602
892
  */
603
893
  bind(connection: Connection | ConnectionTransaction): this;
604
894
  /**
605
- * exceptColumns for method except
606
- * @return {promise<string>} string
607
- */
608
- protected exceptColumns(): Promise<string[]>;
609
- /**
610
- * handler query update for except some columns
611
- * @param {string} column
612
- * @param {string} value
613
- * @return {string} string
614
- */
615
- protected _updateHandler(column: string, value?: string | number): string;
616
- /**
895
+ * This 'rawQuery' method is used to execute sql statement
617
896
  *
618
- * generate sql statements
619
- * @return {string} string generated query string
897
+ * @param {string} sql
898
+ * @return {promise<any>}
620
899
  */
621
- protected _buildQueryStatement(): string;
900
+ rawQuery(sql: string): Promise<any>;
622
901
  /**
623
- * execute sql statements with raw sql query
624
- * @param {string} sql sql execute return data
902
+ * This 'query' method is used to execute sql statement
903
+ *
904
+ * @param {string} sql
625
905
  * @return {promise<any>}
626
906
  */
627
- rawQuery(sql: string): Promise<any>;
907
+ query(sql: string): Promise<any>;
628
908
  /**
629
909
  *
630
910
  * plus value then update
@@ -641,21 +921,27 @@ declare class Builder extends AbstractBuilder {
641
921
  * @return {promise<any>}
642
922
  */
643
923
  decrement(column?: string, value?: number): Promise<any>;
924
+ version(): Promise<string>;
644
925
  /**
645
- * execute data without condition
926
+ * The 'all' method is used to retrieve all records from a database table associated.
927
+ *
928
+ * It returns an array instances, ignore all condition.
646
929
  * @return {promise<any>}
647
930
  */
648
931
  all(): Promise<any>;
649
932
  /**
933
+ * The 'find' method is used to retrieve a single record from a database table by its primary key.
650
934
  *
651
- * execute data with where by primary key default = id
935
+ * This method allows you to quickly fetch a specific record by specifying the primary key value, which is typically an integer id.
652
936
  * @param {number} id
653
937
  * @return {promise<any>}
654
938
  */
655
939
  find(id: number): Promise<Record<string, any> | null>;
656
940
  /**
941
+ * The 'pagination' method is used to perform pagination on a set of database query results obtained through the Query Builder.
657
942
  *
658
- * execute data page & limit
943
+ * It allows you to split a large set of query results into smaller, more manageable pages,
944
+ * making it easier to display data in a web application and improve user experience
659
945
  * @param {?object} paginationOptions
660
946
  * @param {number} paginationOptions.limit default 15
661
947
  * @param {number} paginationOptions.page default 1
@@ -666,8 +952,10 @@ declare class Builder extends AbstractBuilder {
666
952
  page?: number;
667
953
  }): Promise<Pagination>;
668
954
  /**
955
+ * The 'paginate' method is used to perform pagination on a set of database query results obtained through the Query Builder.
669
956
  *
670
- * execute data useing page & limit
957
+ * It allows you to split a large set of query results into smaller, more manageable pages,
958
+ * making it easier to display data in a web application and improve user experience
671
959
  * @param {?object} paginationOptions
672
960
  * @param {number} paginationOptions.limit
673
961
  * @param {number} paginationOptions.page
@@ -679,164 +967,219 @@ declare class Builder extends AbstractBuilder {
679
967
  }): Promise<Pagination>;
680
968
  /**
681
969
  *
682
- * execute data return object | null
970
+ * The 'first' method is used to retrieve the first record that matches the query conditions.
971
+ *
972
+ * It allows you to retrieve a single record from a database table that meets the specified criteria.
683
973
  * @return {promise<object | null>}
684
974
  */
685
975
  first(): Promise<Record<string, any> | null>;
686
976
  /**
687
977
  *
688
- * execute data return object | null
978
+ * The 'findOne' method is used to retrieve the first record that matches the query conditions.
979
+ *
980
+ * It allows you to retrieve a single record from a database table that meets the specified criteria.
689
981
  * @return {promise<object | null>}
690
982
  */
691
983
  findOne(): Promise<Record<string, any> | null>;
692
984
  /**
985
+ * The 'firstOrError' method is used to retrieve the first record that matches the query conditions.
986
+ *
987
+ * It allows you to retrieve a single record from a database table that meets the specified criteria.
693
988
  *
694
- * execute data return object | throw Error
989
+ * If record is null, this method will throw an error
695
990
  * @return {promise<object | Error>}
696
991
  */
697
992
  firstOrError(message: string, options?: Record<string, any>): Promise<Record<string, any>>;
698
993
  /**
994
+ * The 'findOneOrError' method is used to retrieve the first record that matches the query conditions.
699
995
  *
996
+ * It allows you to retrieve a single record from a database table that meets the specified criteria.
997
+ *
998
+ * If record is null, this method will throw an error
700
999
  * execute data return object | null
701
1000
  * @return {promise<object | null>}
702
1001
  */
703
1002
  findOneOrError(message: string, options?: Record<string, any>): Promise<Record<string, any>>;
704
1003
  /**
1004
+ * The 'get' method is used to execute a database query and retrieve the result set that matches the query conditions.
705
1005
  *
706
- * execute data return Array
1006
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
707
1007
  * @return {promise<any[]>}
708
1008
  */
709
1009
  get(): Promise<any[]>;
710
1010
  /**
1011
+ * The 'findMany' method is used to execute a database query and retrieve the result set that matches the query conditions.
711
1012
  *
712
- * execute data return Array
1013
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
713
1014
  * @return {promise<any[]>}
714
1015
  */
715
1016
  findMany(): Promise<any[]>;
716
1017
  /**
717
1018
  *
718
- * execute data return json of result
1019
+ * The 'toJSON' method is used to execute a database query and retrieve the result set that matches the query conditions.
1020
+ *
1021
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
1022
+ *
1023
+ * It returns a JSON formatted
719
1024
  * @return {promise<string>}
720
1025
  */
721
1026
  toJSON(): Promise<string>;
722
1027
  /**
1028
+ * The 'toArray' method is used to execute a database query and retrieve the result set that matches the query conditions.
1029
+ *
1030
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
723
1031
  *
724
- * execute data return array of results
1032
+ * It returns an array formatted
725
1033
  * @param {string=} column [column=id]
726
1034
  * @return {promise<Array>}
727
1035
  */
728
1036
  toArray(column?: string): Promise<any[]>;
729
1037
  /**
1038
+ * The 'exists' method is used to determine if any records exist in the database table that match the query conditions.
730
1039
  *
731
- * execute data return result is exists
1040
+ * It returns a boolean value indicating whether there are any matching records.
732
1041
  * @return {promise<boolean>}
733
1042
  */
734
1043
  exists(): Promise<boolean>;
735
1044
  /**
1045
+ * The 'count' method is used to retrieve the total number of records that match the specified query conditions.
736
1046
  *
737
- * execute data return number of results
1047
+ * It returns an integer representing the count of records.
738
1048
  * @param {string=} column [column=id]
739
1049
  * @return {promise<number>}
740
1050
  */
741
1051
  count(column?: string): Promise<number>;
742
1052
  /**
1053
+ * The 'avg' method is used to calculate the average value of a numeric column in a database table.
743
1054
  *
744
- * execute data return average of results
1055
+ * It calculates the mean value of the specified column for all records that match the query conditions and returns the result as a floating-point number.
745
1056
  * @param {string=} column [column=id]
746
1057
  * @return {promise<number>}
747
1058
  */
748
1059
  avg(column?: string): Promise<number>;
749
1060
  /**
1061
+ * The 'sum' method is used to calculate the sum of values in a numeric column of a database table.
750
1062
  *
751
- * execute data return summary of results
1063
+ * It computes the total of the specified column's values for all records that match the query conditions and returns the result as a numeric value.
752
1064
  * @param {string=} column [column=id]
753
1065
  * @return {promise<number>}
754
1066
  */
755
1067
  sum(column?: string): Promise<number>;
756
1068
  /**
1069
+ * The 'max' method is used to retrieve the maximum value of a numeric column in a database table.
757
1070
  *
758
- * execute data return maximum of results
1071
+ * It finds the highest value in the specified column among all records that match the query conditions and returns that value.
759
1072
  * @param {string=} column [column=id]
760
1073
  * @return {promise<number>}
761
1074
  */
762
1075
  max(column?: string): Promise<number>;
763
1076
  /**
1077
+ * The 'min' method is used to retrieve the minimum (lowest) value of a numeric column in a database table.
764
1078
  *
765
- * execute data return minimum of results
1079
+ * It finds the smallest value in the specified column among all records that match the query conditions and returns that value.
766
1080
  * @param {string=} column [column=id]
767
1081
  * @return {promise<number>}
768
1082
  */
769
1083
  min(column?: string): Promise<number>;
770
1084
  /**
1085
+ * The 'delete' method is used to delete records from a database table based on the specified query conditions.
771
1086
  *
772
- * delete data from database
1087
+ * It allows you to remove one record that match certain criteria.
773
1088
  * @return {promise<boolean>}
774
1089
  */
775
1090
  delete(): Promise<boolean>;
776
1091
  /**
1092
+ * The 'deleteMany' method is used to delete records from a database table based on the specified query conditions.
1093
+ *
1094
+ * It allows you to remove more records that match certain criteria.
1095
+ * @return {promise<boolean>}
1096
+ */
1097
+ deleteMany(): Promise<boolean>;
1098
+ /**
1099
+ *
1100
+ * The 'delete' method is used to delete records from a database table based on the specified query conditions.
777
1101
  *
778
- * delete data from database ignore where condition
1102
+ * It allows you to remove one or more records that match certain criteria.
1103
+ *
1104
+ * This method should be ignore the soft delete
779
1105
  * @return {promise<boolean>}
780
1106
  */
781
1107
  forceDelete(): Promise<boolean>;
782
1108
  /**
1109
+ * The 'getGroupBy' method is used to execute a database query and retrieve the result set that matches the query conditions.
1110
+ *
1111
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
783
1112
  *
784
- * execute data return Array *grouping results in column
1113
+ * It returns record an Array-Object key by column *grouping results in column
785
1114
  * @param {string} column
786
1115
  * @return {promise<Array>}
787
1116
  */
788
1117
  getGroupBy(column: string): Promise<any[]>;
789
1118
  /**
790
1119
  *
791
- * execute data return grouping results by index
1120
+ * The 'getGroupBy' method is used to execute a database query and retrieve the result set that matches the query conditions.
1121
+ *
1122
+ * It retrieves multiple records from a database table based on the criteria specified in the query.
1123
+ *
1124
+ * It returns record an Array-Object key by column *grouping results in column
792
1125
  * @param {string} column
793
1126
  * @return {promise<Array>}
794
1127
  */
795
1128
  findManyGroupBy(column: string): Promise<any[]>;
796
1129
  /**
797
- * execute data when save *action [insert , update]
1130
+ * The 'save' method is used to persist a new 'Model' or new 'DB' instance or update an existing model instance in the database.
1131
+ *
1132
+ * It's a versatile method that can be used in various scenarios, depending on whether you're working with a new or existing record.
798
1133
  * @return {Promise<any>} promise
799
1134
  */
800
1135
  save(): Promise<Record<string, any> | any[] | null | undefined>;
801
1136
  /**
1137
+ * The 'showTables' method is used to show schema table.
1138
+ *
1139
+ * @return {Promise<Array>}
1140
+ */
1141
+ showTables(): Promise<string[]>;
1142
+ /**
1143
+ *
1144
+ * The 'showColumns' method is used to show columns table.
802
1145
  *
803
- * show columns in table
804
1146
  * @param {string=} table table name
805
1147
  * @return {Promise<Array>}
806
1148
  */
807
1149
  showColumns(table?: string): Promise<string[]>;
808
1150
  /**
1151
+ * The 'showSchema' method is used to show schema table.
809
1152
  *
810
- * show schemas in table
811
1153
  * @param {string=} table [table= current table name]
812
1154
  * @return {Promise<Array>}
813
1155
  */
814
- showSchemas(table?: string): Promise<string[]>;
1156
+ showSchema(table?: string): Promise<string[]>;
815
1157
  /**
1158
+ * The 'showSchemas' method is used to show schema table.
816
1159
  *
817
- * get schema from table
818
- * @return {this} this this
1160
+ * @param {string=} table [table= current table name]
1161
+ * @return {Promise<Array>}
819
1162
  */
820
- getSchema(): Promise<any>;
1163
+ showSchemas(table?: string): Promise<string[]>;
821
1164
  /**
822
1165
  *
823
- * show values in table
1166
+ * The 'showValues' method is used to show values table.
1167
+ *
824
1168
  * @param {string=} table table name
825
1169
  * @return {Promise<Array>}
826
1170
  */
827
1171
  showValues(table?: string): Promise<string[]>;
1172
+ private _backup;
828
1173
  /**
829
1174
  *
830
1175
  * backup this database intro new database same server or to another server
831
1176
  * @param {Object} backupOptions
832
- * @param {string} backup.database
1177
+ * @param {string} backup.database clone current 'db' in connection to this database
833
1178
  * @param {object?} backup.to
834
1179
  * @param {string} backup.to.host
835
1180
  * @param {number} backup.to.port
836
- * @param {string} backup.to.database
837
1181
  * @param {string} backup.to.username
838
1182
  * @param {string} backup.to.password
839
-
840
1183
  * @return {Promise<boolean>}
841
1184
  */
842
1185
  backup({ database, to }: Backup): Promise<boolean>;
@@ -902,7 +1245,9 @@ declare class Builder extends AbstractBuilder {
902
1245
  backupTableSchemaToFile({ filePath, table, connection }: BackupTableToFile): Promise<void>;
903
1246
  /**
904
1247
  *
905
- * fake data
1248
+ * The 'faker' method is used to insert a new records into a database table associated.
1249
+ *
1250
+ * It simplifies the process of creating and inserting records.
906
1251
  * @param {number} rows number of rows
907
1252
  * @return {promise<any>}
908
1253
  */
@@ -919,22 +1264,44 @@ declare class Builder extends AbstractBuilder {
919
1264
  * @return {promise<boolean>}
920
1265
  */
921
1266
  drop(): Promise<boolean>;
922
- protected resultHandler(data: any): any;
923
- /**
924
- *
925
- * @param {string} tableAndLocalKey
926
- * @param {string?} tableAndForeignKey
927
- * @return {this}
928
- */
929
- protected whereReference(tableAndLocalKey: string, tableAndForeignKey?: string): this;
930
- private _queryWhereIsExists;
931
- private _bindTableAndColumnInQueryWhere;
932
- private _insertNotExists;
933
- protected queryStatement(sql: string): Promise<any[]>;
934
- protected actionStatement({ sql, returnId }: {
1267
+ protected _exceptColumns(): Promise<string[]>;
1268
+ protected _updateHandler(column: string, value?: string | number | null | boolean): string;
1269
+ protected copyBuilder(instance: Builder, options?: {
1270
+ update?: boolean;
1271
+ insert?: boolean;
1272
+ delete?: boolean;
1273
+ where?: boolean;
1274
+ limit?: boolean;
1275
+ offset?: boolean;
1276
+ join?: boolean;
1277
+ groupBy?: boolean;
1278
+ select?: boolean;
1279
+ }): Builder;
1280
+ protected _queryBuilder(): {
1281
+ select: () => string;
1282
+ insert: () => string;
1283
+ update: () => string;
1284
+ delete: () => string;
1285
+ any: () => string;
1286
+ };
1287
+ protected _buildQueryStatement(): {
1288
+ select: () => string;
1289
+ insert: () => string;
1290
+ update: () => string;
1291
+ delete: () => string;
1292
+ any: () => string;
1293
+ };
1294
+ protected _getState(key: string): any;
1295
+ protected _setState(key: string, value: any): void;
1296
+ protected _resultHandler(data: any): any;
1297
+ whereReference(tableAndLocalKey: string, tableAndForeignKey?: string): this;
1298
+ protected _queryStatement(sql: string): Promise<any[]>;
1299
+ protected _actionStatement({ sql, returnId }: {
935
1300
  sql: string;
936
1301
  returnId?: boolean;
937
1302
  }): Promise<any>;
1303
+ private _queryWhereIsExists;
1304
+ private _insertNotExists;
938
1305
  private _insert;
939
1306
  private _checkValueHasRaw;
940
1307
  private _insertMultiple;