tspace-mysql 1.9.4 → 1.9.5
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.
- package/README.md +376 -72
- package/dist/cli/dump/db.js +3 -15
- package/dist/cli/dump/db.js.map +1 -1
- package/dist/cli/index.js +0 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/migrations/make-db.js +1 -1
- package/dist/cli/migrations/make-db.js.map +1 -1
- package/dist/cli/migrations/make-model.js +1 -6
- package/dist/cli/migrations/make-model.js.map +1 -1
- package/dist/lib/config/index.d.ts +6 -5
- package/dist/lib/config/index.js +18 -8
- package/dist/lib/config/index.js.map +1 -1
- package/dist/lib/constants/index.d.ts +1 -1
- package/dist/lib/constants/index.js +1 -1
- package/dist/lib/constants/index.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractBuilder.d.ts +2 -1
- package/dist/lib/core/Abstracts/AbstractDB.d.ts +5 -3
- package/dist/lib/core/Abstracts/AbstractDB.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractModel.d.ts +1 -2
- package/dist/lib/core/Abstracts/AbstractModel.js +0 -1
- package/dist/lib/core/Abstracts/AbstractModel.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractView.d.ts +2 -1
- package/dist/lib/core/Abstracts/AbstractView.js.map +1 -1
- package/dist/lib/core/Blueprint.d.ts +13 -3
- package/dist/lib/core/Blueprint.js +16 -1
- package/dist/lib/core/Blueprint.js.map +1 -1
- package/dist/lib/core/Builder.d.ts +172 -19
- package/dist/lib/core/Builder.js +564 -197
- package/dist/lib/core/Builder.js.map +1 -1
- package/dist/lib/core/Cache/DBCache.js +6 -5
- package/dist/lib/core/Cache/DBCache.js.map +1 -1
- package/dist/lib/core/Cache/index.js +1 -1
- package/dist/lib/core/Cache/index.js.map +1 -1
- package/dist/lib/core/Contracts/Audit.d.ts +5 -3
- package/dist/lib/core/Contracts/Audit.js +18 -2
- package/dist/lib/core/Contracts/Audit.js.map +1 -1
- package/dist/lib/core/DB.d.ts +148 -190
- package/dist/lib/core/DB.js +459 -525
- package/dist/lib/core/DB.js.map +1 -1
- package/dist/lib/core/Driver/index.d.ts +40 -15
- package/dist/lib/core/Driver/index.js +3 -0
- package/dist/lib/core/Driver/index.js.map +1 -1
- package/dist/lib/core/Driver/mariadb/MariadbDriver.d.ts +3 -2
- package/dist/lib/core/Driver/mariadb/MariadbDriver.js +7 -5
- package/dist/lib/core/Driver/mariadb/MariadbDriver.js.map +1 -1
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.d.ts +42 -17
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.js +281 -154
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/mongodb/MongodbDriver.d.ts +4 -3
- package/dist/lib/core/Driver/mongodb/MongodbDriver.js +7 -5
- package/dist/lib/core/Driver/mongodb/MongodbDriver.js.map +1 -1
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.d.ts +40 -15
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.js +205 -157
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/mysql/MysqlDriver.d.ts +3 -2
- package/dist/lib/core/Driver/mysql/MysqlDriver.js +6 -14
- package/dist/lib/core/Driver/mysql/MysqlDriver.js.map +1 -1
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.d.ts +42 -17
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.js +251 -144
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/postgres/PostgresDriver.d.ts +3 -2
- package/dist/lib/core/Driver/postgres/PostgresDriver.js +7 -5
- package/dist/lib/core/Driver/postgres/PostgresDriver.js.map +1 -1
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.d.ts +45 -19
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.js +471 -287
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/sqlite/SqliteDriver.d.ts +3 -2
- package/dist/lib/core/Driver/sqlite/SqliteDriver.js +8 -6
- package/dist/lib/core/Driver/sqlite/SqliteDriver.js.map +1 -1
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.d.ts +47 -19
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.js +331 -203
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.js.map +1 -1
- package/dist/lib/core/Model.d.ts +255 -52
- package/dist/lib/core/Model.js +459 -117
- package/dist/lib/core/Model.js.map +1 -1
- package/dist/lib/core/Package.d.ts +5 -0
- package/dist/lib/core/Package.js +7 -2
- package/dist/lib/core/Package.js.map +1 -1
- package/dist/lib/core/Pool.d.ts +1 -1
- package/dist/lib/core/Pool.js +53 -75
- package/dist/lib/core/Pool.js.map +1 -1
- package/dist/lib/core/Queue/index.d.ts +2 -11
- package/dist/lib/core/Queue/index.js +3 -3
- package/dist/lib/core/Queue/index.js.map +1 -1
- package/dist/lib/core/Queue/types.d.ts +32 -3
- package/dist/lib/core/Queue/worker-lock.d.ts +17 -0
- package/dist/lib/core/Queue/worker-lock.js +28 -0
- package/dist/lib/core/Queue/worker-lock.js.map +1 -0
- package/dist/lib/core/Queue/worker.d.ts +37 -23
- package/dist/lib/core/Queue/worker.js +385 -171
- package/dist/lib/core/Queue/worker.js.map +1 -1
- package/dist/lib/core/RelationManager.js +1 -1
- package/dist/lib/core/RelationManager.js.map +1 -1
- package/dist/lib/core/Repository.d.ts +164 -29
- package/dist/lib/core/Repository.js +181 -40
- package/dist/lib/core/Repository.js.map +1 -1
- package/dist/lib/core/Schema.d.ts +11 -7
- package/dist/lib/core/Schema.js +249 -80
- package/dist/lib/core/Schema.js.map +1 -1
- package/dist/lib/core/SqlLike.js +4 -4
- package/dist/lib/core/SqlLike.js.map +1 -1
- package/dist/lib/core/StateManager.d.ts +19 -0
- package/dist/lib/core/StateManager.js +9 -4
- package/dist/lib/core/StateManager.js.map +1 -1
- package/dist/lib/core/UtilityTypes.d.ts +17 -3
- package/dist/lib/core/UtilityTypes.js.map +1 -1
- package/dist/lib/core/View.d.ts +3 -1
- package/dist/lib/core/View.js +18 -25
- package/dist/lib/core/View.js.map +1 -1
- package/dist/lib/core/index.d.ts +2 -0
- package/dist/lib/core/index.js +3 -1
- package/dist/lib/core/index.js.map +1 -1
- package/dist/lib/types/index.d.ts +77 -90
- package/dist/lib/types/repository/index.d.ts +18 -26
- package/dist/lib/utils/index.d.ts +7 -3
- package/dist/lib/utils/index.js +99 -37
- package/dist/lib/utils/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/cli/dump/table.d.ts +0 -4
- package/dist/cli/dump/table.js +0 -41
- package/dist/cli/dump/table.js.map +0 -1
|
@@ -86,46 +86,52 @@ export type TPagination<K = any> = {
|
|
|
86
86
|
};
|
|
87
87
|
data: K[];
|
|
88
88
|
};
|
|
89
|
+
export type TCursorPagination<T = any> = {
|
|
90
|
+
meta: {
|
|
91
|
+
limit: number;
|
|
92
|
+
count: number;
|
|
93
|
+
next: {
|
|
94
|
+
cursor: string | null;
|
|
95
|
+
has: boolean;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
data: T[];
|
|
99
|
+
};
|
|
89
100
|
export type TSave = "INSERT" | "INSERT_MULTIPLE" | "INSERT_NOT_EXISTS" | "INSERT_OR_SELECT" | "UPDATE" | "UPDATE_OR_INSERT";
|
|
90
|
-
export type
|
|
101
|
+
export type TClone = {
|
|
91
102
|
database: string;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
excludes?: string[];
|
|
104
|
+
only?: never;
|
|
105
|
+
value?: boolean;
|
|
106
|
+
to?: TConnectionOptions;
|
|
107
|
+
} | {
|
|
108
|
+
database: string;
|
|
109
|
+
only?: string[];
|
|
110
|
+
excludes?: never;
|
|
111
|
+
value?: boolean;
|
|
112
|
+
to?: TConnectionOptions;
|
|
99
113
|
};
|
|
100
|
-
export type
|
|
101
|
-
database?: string;
|
|
114
|
+
export type TDump = ({
|
|
102
115
|
filePath: string;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
username: string;
|
|
109
|
-
password: string;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
export type TBackupTableToFile = {
|
|
116
|
+
only?: string[];
|
|
117
|
+
excludes?: never;
|
|
118
|
+
database?: string;
|
|
119
|
+
value?: boolean;
|
|
120
|
+
} | {
|
|
113
121
|
filePath: string;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
username: string;
|
|
120
|
-
password: string;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
122
|
+
only?: never;
|
|
123
|
+
excludes?: string[];
|
|
124
|
+
database?: string;
|
|
125
|
+
value?: boolean;
|
|
126
|
+
});
|
|
123
127
|
export type TConnectionOptions = {
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
driver: AssertDriver<'sqlite'>;
|
|
129
|
+
database: string;
|
|
130
|
+
} | {
|
|
131
|
+
driver: Exclude<TDriver, AssertDriver<'sqlite'>>;
|
|
126
132
|
host: string;
|
|
127
133
|
port: number;
|
|
128
|
-
database
|
|
134
|
+
database: string;
|
|
129
135
|
username: string;
|
|
130
136
|
password: string;
|
|
131
137
|
};
|
|
@@ -133,35 +139,9 @@ export type TPoolCallback = {
|
|
|
133
139
|
query: (sql: string, callback: (err: any, result: any) => void) => void;
|
|
134
140
|
release: () => void;
|
|
135
141
|
};
|
|
136
|
-
export type TConnectionTransaction = {
|
|
137
|
-
query: (sql: string) => Promise<any[]>;
|
|
138
|
-
/**
|
|
139
|
-
* The 'startTransaction' method is used when need to started the transaction
|
|
140
|
-
* @returns {Promise<void>}
|
|
141
|
-
*/
|
|
142
|
-
startTransaction: () => Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* The 'commit' method is used to when need to commit the transactions is successfully
|
|
145
|
-
* @returns {Promise<void>}
|
|
146
|
-
*/
|
|
147
|
-
commit: () => Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* The 'rollback ' method is used to when the transaction is failed
|
|
150
|
-
* @returns {Promise<void>}
|
|
151
|
-
*/
|
|
152
|
-
rollback: () => Promise<void>;
|
|
153
|
-
/**
|
|
154
|
-
* The 'end ' method is used to end the transction
|
|
155
|
-
* @returns {Promise<void>}
|
|
156
|
-
*/
|
|
157
|
-
end: () => Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* The 'release' method is used to release connection
|
|
160
|
-
* @returns {Promise<void>}
|
|
161
|
-
*/
|
|
162
|
-
release: () => Promise<void>;
|
|
163
|
-
};
|
|
164
142
|
export type TConnection = {
|
|
143
|
+
driver: () => TDriver;
|
|
144
|
+
database: () => string;
|
|
165
145
|
on: (event: TPoolEvent, data: any) => void;
|
|
166
146
|
query: (sql: string) => Promise<any[]>;
|
|
167
147
|
queryBuilder: typeof QueryBuilder;
|
|
@@ -172,6 +152,7 @@ export type TConnection = {
|
|
|
172
152
|
release: () => Promise<void>;
|
|
173
153
|
};
|
|
174
154
|
export type TPoolConnected = {
|
|
155
|
+
driver: () => TDriver;
|
|
175
156
|
database: () => string;
|
|
176
157
|
on: (event: TPoolEvent, data: (r: any) => any) => void;
|
|
177
158
|
queryBuilder: typeof QueryBuilder;
|
|
@@ -189,7 +170,7 @@ export type TModelOrObject = {
|
|
|
189
170
|
export type TCreateNewConnection = {
|
|
190
171
|
on: (event: TPoolEvent, data: (r: any) => any) => void;
|
|
191
172
|
query: (sql: string) => Promise<any>;
|
|
192
|
-
connection: () => Promise<
|
|
173
|
+
connection: () => Promise<TConnection>;
|
|
193
174
|
};
|
|
194
175
|
export type TOptions = {
|
|
195
176
|
[key: string]: any;
|
|
@@ -321,21 +302,7 @@ export type TLiteralStringKeys<T> = {
|
|
|
321
302
|
[K in keyof T]: T[K] extends string ? (string extends T[K] ? never : K) : never;
|
|
322
303
|
}[keyof T];
|
|
323
304
|
export type TLiteralEnumKeys<T> = TLiteralStringKeys<TRemoveIndexSignature<T>>;
|
|
324
|
-
export type TDriver = '
|
|
325
|
-
export type TPoolCusterOptions = {
|
|
326
|
-
writer: {
|
|
327
|
-
host: string;
|
|
328
|
-
user: string;
|
|
329
|
-
password: string;
|
|
330
|
-
database: string;
|
|
331
|
-
};
|
|
332
|
-
readers: {
|
|
333
|
-
host: string;
|
|
334
|
-
user: string;
|
|
335
|
-
password: string;
|
|
336
|
-
database: string;
|
|
337
|
-
}[];
|
|
338
|
-
};
|
|
305
|
+
export type TDriver = 'postgres' | 'mysql' | 'mariadb' | 'sqlite' | 'mongodb';
|
|
339
306
|
type TClusterPool = {
|
|
340
307
|
pool: {
|
|
341
308
|
type: string;
|
|
@@ -345,6 +312,8 @@ type TClusterPool = {
|
|
|
345
312
|
username: string;
|
|
346
313
|
};
|
|
347
314
|
on: (event: TPoolEvent, data: (r: any) => any) => void;
|
|
315
|
+
database: () => string;
|
|
316
|
+
driver: () => TDriver;
|
|
348
317
|
queryBuilder: typeof QueryBuilder;
|
|
349
318
|
query: (sql: string) => Promise<any[]>;
|
|
350
319
|
connection: () => Promise<TConnection>;
|
|
@@ -354,18 +323,18 @@ export type TPoolCusterConnected = {
|
|
|
354
323
|
database?: () => string;
|
|
355
324
|
query?: Function | null;
|
|
356
325
|
queryBuilder?: QueryBuilder | null;
|
|
357
|
-
|
|
358
|
-
|
|
326
|
+
primary: TClusterPool;
|
|
327
|
+
replicas: TClusterPool[];
|
|
359
328
|
};
|
|
360
329
|
export type TIsEnum<T> = T extends {
|
|
361
330
|
__isDefault: true;
|
|
362
|
-
} ?
|
|
331
|
+
} ? TIsEnum<TRemoveDefault<T>> : string extends T ? false : number extends T ? false : boolean extends T ? false : [
|
|
363
332
|
T
|
|
364
333
|
] extends [string | number] ? true : false;
|
|
365
334
|
export type TLifecycle = "beforeInsert" | "afterInsert" | "beforeUpdate" | "afterUpdate" | "beforeRemove" | "afterRemove";
|
|
366
|
-
export type TDeepOmit<T, Filter> = T extends infer
|
|
367
|
-
[K in keyof
|
|
368
|
-
} :
|
|
335
|
+
export type TDeepOmit<T, Filter> = T extends Date | Function ? T : T extends (infer U)[] ? TDeepOmit<U, Filter>[] : T extends object ? {
|
|
336
|
+
[K in keyof T as K extends keyof Filter ? Filter[K] extends true ? never : K : K]: K extends keyof Filter ? Filter[K] extends object ? TDeepOmit<NonNullable<T[K]>, Filter[K]> : T[K] : T[K];
|
|
337
|
+
} : T;
|
|
369
338
|
export type TDeepExpand<T> = T extends TDefault<infer D> ? D : T extends Date ? T : T extends Function ? T : T extends Model ? T : T extends (infer U)[] ? TDeepExpand<U>[] : T extends object ? {
|
|
370
339
|
[K in keyof T]: TDeepExpand<T[K]>;
|
|
371
340
|
} : T;
|
|
@@ -386,7 +355,7 @@ type IsStrict<T> = T extends true ? false : T extends object ? (T extends {
|
|
|
386
355
|
select: any;
|
|
387
356
|
} ? true : T extends {
|
|
388
357
|
except: any;
|
|
389
|
-
} ? false :
|
|
358
|
+
} ? false : false) : false;
|
|
390
359
|
type RemoveUndefined<T> = T extends undefined ? never : T;
|
|
391
360
|
type NonObjectKeys<T> = {
|
|
392
361
|
[K in keyof T]: RemoveUndefined<T[K]> extends Date ? K : RemoveUndefined<T[K]> extends object ? never : K;
|
|
@@ -394,11 +363,14 @@ type NonObjectKeys<T> = {
|
|
|
394
363
|
type GetExceptKeys<T> = T extends {
|
|
395
364
|
_except: infer E;
|
|
396
365
|
} ? keyof E : never;
|
|
397
|
-
export type TSelectionMerger<IncomingResult, S1, S2> = IncomingResult extends Date | Function ? IncomingResult : IncomingResult extends (infer U)[] ? TSelectionMerger<U, S1, S2>[] : IncomingResult extends object ?
|
|
398
|
-
[K in keyof Omit<Merged, '_except'> & keyof IncomingResult]-?: TSelectionMerger<RemoveUndefined<IncomingResult[K]>, K extends keyof F1 ? F1[K] : unknown, K extends keyof F2 ? F2[K] : unknown>;
|
|
366
|
+
export type TSelectionMerger<IncomingResult, S1, S2> = IncomingResult extends Date | Function ? IncomingResult : IncomingResult extends (infer U)[] ? TSelectionMerger<U, S1, S2>[] : IncomingResult extends object ? Normalize<S1> extends infer F1 ? Normalize<S2> extends infer F2 ? (F1 & F2) extends infer Merged ? {
|
|
367
|
+
[K in keyof Omit<Merged, '_except'> & keyof IncomingResult as Merged[K] extends false ? never : K]-?: TSelectionMerger<RemoveUndefined<IncomingResult[K]>, K extends keyof F1 ? F1[K] : unknown, K extends keyof F2 ? F2[K] : unknown>;
|
|
399
368
|
} & ((IsStrict<S1> extends true ? true : IsStrict<S2> extends true ? true : false) extends true ? {} : {
|
|
400
|
-
[K in Exclude<NonObjectKeys<IncomingResult>, GetExceptKeys<F1> | GetExceptKeys<F2>>]
|
|
401
|
-
}) : never : never : never
|
|
369
|
+
[K in Exclude<NonObjectKeys<IncomingResult>, GetExceptKeys<F1> | GetExceptKeys<F2>> as string extends K ? never : K]: IncomingResult[K];
|
|
370
|
+
}) : never : never : never : IncomingResult;
|
|
371
|
+
export type TSelection<IncomingResult, S1> = IncomingResult extends Date | Function ? IncomingResult : IncomingResult extends (infer U)[] ? TSelection<U, S1>[] : IncomingResult extends object ? Normalize<S1> extends infer F1 ? {
|
|
372
|
+
[K in keyof F1 & keyof IncomingResult as F1[K] extends false ? never : K]-?: F1[K] extends true ? IncomingResult[K] : TSelection<RemoveUndefined<IncomingResult[K]>, F1[K]>;
|
|
373
|
+
} : never : IncomingResult;
|
|
402
374
|
export type TStateWhereCondition = {
|
|
403
375
|
column?: string;
|
|
404
376
|
operator?: string;
|
|
@@ -406,7 +378,7 @@ export type TStateWhereCondition = {
|
|
|
406
378
|
condition?: 'AND' | 'OR';
|
|
407
379
|
nested?: TStateWhereCondition[];
|
|
408
380
|
};
|
|
409
|
-
export type TDefault<T = any> = (string extends T ? string : boolean extends T ?
|
|
381
|
+
export type TDefault<T = any> = (string extends T ? string : boolean extends T ? Boolean | number : number extends T ? number : Date extends T ? Date : `${T & string}` | null) & {
|
|
410
382
|
__isDefault: true;
|
|
411
383
|
};
|
|
412
384
|
export type TRemoveDefault<T> = T extends TDefault<infer U> ? U : T;
|
|
@@ -437,10 +409,25 @@ export type TInsertOrUpdateInput<K, C> = {
|
|
|
437
409
|
[Q in Exclude<Extract<K, keyof C>, P>]?: TCleanDefaultType<C[Q]>;
|
|
438
410
|
};
|
|
439
411
|
}[Extract<K, keyof C>];
|
|
440
|
-
export type TAction = "create" | "createMany" | "createNotExists" | "createOrSelect" | "createOrUpdate" | "update" | "updateMany" | null;
|
|
412
|
+
export type TAction = "create" | "createMany" | "createNotExists" | "createOrSelect" | "createOrUpdate" | "update" | "updateMany" | void | null;
|
|
441
413
|
export type TSaveBuilderResult<A extends TAction> = A extends "create" ? Record<string, any> : A extends "createMany" ? Record<string, any>[] : A extends "createNotExists" ? Record<string, any> | null : A extends "createOrUpdate" ? Record<string, any> : A extends "createOrSelect" ? Record<string, any> : A extends "update" ? Record<string, any> | null : A extends "updateMany" ? Record<string, any>[] : any;
|
|
442
|
-
export type TSaveModelResult<M extends Model<any, any, any>, A extends TAction> = A extends "create" ? T.InsertResult<M> : A extends "createMany" ? T.InsertManyResult<M> : A extends "createNotExists" ? T.InsertResult<M> | null : A extends "createOrUpdate" ? T.Result<M> : A extends "createOrSelect" ? T.Result<M> : A extends "update" ? T.UpdateResult<M> : A extends "updateMany" ? T.UpdateManyResult<M> : T.InsertResult<M> | T.InsertManyResult<M> | T.UpdateResult<M> | T.UpdateManyResult<M> | T.Result<M>;
|
|
414
|
+
export type TSaveModelResult<M extends Model<any, any, any>, A extends TAction> = A extends "create" ? T.InsertResult<M> : A extends "createMany" ? T.InsertManyResult<M> : A extends "createNotExists" ? T.InsertResult<M> | null : A extends "createOrUpdate" ? T.Result<M> : A extends "createOrSelect" ? T.Result<M> : A extends "update" ? T.UpdateResult<M> : A extends "updateMany" ? T.UpdateManyResult<M> : A extends void ? void : T.InsertResult<M> | T.InsertManyResult<M> | T.UpdateResult<M> | T.UpdateManyResult<M> | T.Result<M>;
|
|
443
415
|
export type TAnyKeys = {
|
|
444
416
|
[customKey: string]: unknown;
|
|
445
417
|
};
|
|
418
|
+
export type TExplainIssue = {
|
|
419
|
+
type: 'FULL_SCAN' | 'LARGE_SCAN' | 'NO_INDEX' | 'FILE_SORT' | 'FILTER_AFTER_SCAN' | 'TEMPORARY_TABLE';
|
|
420
|
+
severity: 'info' | 'warning' | 'critical';
|
|
421
|
+
message: string;
|
|
422
|
+
};
|
|
423
|
+
export type TExplain<K = any> = {
|
|
424
|
+
sql: string;
|
|
425
|
+
plan: K[];
|
|
426
|
+
analysis: {
|
|
427
|
+
status: 'ok' | 'warning' | 'critical';
|
|
428
|
+
issues: TExplainIssue[];
|
|
429
|
+
recommendations: string[];
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
type AssertDriver<T extends TDriver> = T;
|
|
446
433
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Model } from "../../core/Model";
|
|
2
2
|
import type { T } from "../../core";
|
|
3
|
-
import type { TConnection,
|
|
3
|
+
import type { TConnection, TFreezeStringQuery, TInsertInput, TNestedBoolean, TOperatorQuery, TRawStringQuery, TRelationKeys, TSchemaKeys, TUpdateInput } from "..";
|
|
4
4
|
import type { TColumnsDecorator, TRelationsDecorator } from "../decorator";
|
|
5
5
|
export type TRepositorySelect<T = unknown, R = unknown, M extends Model = Model> = [unknown, unknown] extends [T, R] ? keyof TColumnsDecorator<M> extends never ? TNestedBoolean : Partial<{
|
|
6
|
-
[K in keyof TColumnsDecorator<M> | keyof TRelationsDecorator<M>]: K extends `${string}.${string}` | TRawStringQuery ? boolean : K extends keyof TRelationsDecorator<M> ? M[K] extends (infer U)[] ? U extends Model ? "*" | TRepositorySelect<any, unknown, U> : boolean : M[K] extends Model ? "*" | TRepositorySelect<any, unknown, M[K]> : boolean :
|
|
6
|
+
[K in keyof TColumnsDecorator<M> | keyof TRelationsDecorator<M>]: K extends `${string}.${string}` | TRawStringQuery ? boolean : K extends keyof TRelationsDecorator<M> ? M[K] extends (infer U)[] ? U extends Model ? "*" | TRepositorySelect<any, unknown, U> : boolean : M[K] extends Model ? "*" | TRepositorySelect<any, unknown, M[K]> : boolean : boolean;
|
|
7
7
|
}> : Partial<{
|
|
8
|
-
[K in TSchemaKeys<T> | TRelationKeys<R>]: K extends TRelationKeys<R> ? K extends TRawStringQuery | `${string}.${string}` ? boolean : K extends `$${string & K}` ? R extends Record<string, any> ? boolean : never : R extends Record<string, any> ? R[`$${string & K}`] extends (infer U)[] ? U extends Model ? "*" | TRepositorySelect<T.SchemaModel<U>, T.RelationModel<U>> : never : R[`$${K & string}`] extends Model ? "*" | TRepositorySelect<T.SchemaModel<R[`$${K & string}`]>, T.RelationModel<R[`$${K & string}`]>> : never : never : K extends keyof T ? boolean : never;
|
|
8
|
+
[K in TSchemaKeys<T> | (unknown extends R ? never : TRelationKeys<R>)]: unknown extends R ? K extends TSchemaKeys<T> ? boolean : never : K extends TRelationKeys<R> ? K extends TRawStringQuery | `${string}.${string}` ? boolean : K extends `$${string & K}` ? R extends Record<string, any> ? boolean : never : R extends Record<string, any> ? R[`$${string & K}`] extends (infer U)[] ? U extends Model ? "*" | TRepositorySelect<T.SchemaModel<U>, T.RelationModel<U>> : never : R[`$${K & string}`] extends Model ? "*" | TRepositorySelect<T.SchemaModel<R[`$${K & string}`]>, T.RelationModel<R[`$${K & string}`]>> : never : never : K extends keyof T ? boolean : never;
|
|
9
9
|
}>;
|
|
10
10
|
export type TRepositoryExcept<T = unknown, R = unknown, M extends Model = Model> = [unknown, unknown] extends [T, R] ? keyof TColumnsDecorator<M> extends never ? TNestedBoolean : Partial<{
|
|
11
11
|
[K in keyof TColumnsDecorator<M> | keyof TRelationsDecorator<M>]: K extends `${string}.${string}` | TRawStringQuery ? boolean : K extends keyof TRelationsDecorator<M> ? M[K] extends (infer U)[] ? U extends Model ? TRepositoryExcept<any, unknown, U> : boolean : M[K] extends Model ? TRepositoryExcept<any, unknown, M[K]> : boolean : K extends keyof TColumnsDecorator<M> ? boolean : boolean;
|
|
@@ -106,41 +106,33 @@ export type TRepositoryRequestPagination<T extends Record<string, any> = any, R
|
|
|
106
106
|
page?: number;
|
|
107
107
|
};
|
|
108
108
|
export type TRepositoryRequestAggregate<T extends Record<string, any> = any, R = any, M extends Model<any, any> = Model<any, any>> = Partial<Omit<TRepositoryRequest<T, R, M>, "relations" | "relationQuery">>;
|
|
109
|
-
export type TRepositoryCreate<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.
|
|
110
|
-
data:
|
|
111
|
-
[P in Exclude<K & keyof C, "id" | "uuid"> as null extends C[P] ? any : P]: Extract<C[P], Date> extends never ? Extract<C[P], Record<string, unknown>> extends never ? C[P] : string : any;
|
|
112
|
-
};
|
|
109
|
+
export type TRepositoryCreate<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.InputOptions<M> = T.InputOptions<M>> = {
|
|
110
|
+
data: TInsertInput<K, C>;
|
|
113
111
|
debug?: boolean;
|
|
114
|
-
transaction?: TConnection |
|
|
112
|
+
transaction?: TConnection | TConnection;
|
|
115
113
|
noReturn?: NR;
|
|
116
114
|
};
|
|
117
|
-
export type TRepositoryCreateMultiple<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.
|
|
118
|
-
data:
|
|
119
|
-
[P in Exclude<K & keyof C, "id" | "uuid"> as null extends C[P] ? any : undefined extends C[P] ? never : P]: Extract<C[P], Date> extends never ? Extract<C[P], Record<string, unknown>> extends never ? C[P] : string : any;
|
|
120
|
-
}[];
|
|
115
|
+
export type TRepositoryCreateMultiple<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.InputOptions<M> = T.InputOptions<M>> = {
|
|
116
|
+
data: TInsertInput<K, C>[];
|
|
121
117
|
debug?: boolean;
|
|
122
|
-
transaction?: TConnection |
|
|
118
|
+
transaction?: TConnection | TConnection;
|
|
123
119
|
noReturn?: NR;
|
|
124
120
|
};
|
|
125
|
-
export type TRepositoryCreateOrThings<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.
|
|
126
|
-
data:
|
|
127
|
-
[P in Exclude<K & keyof C, "id" | "uuid"> as null extends C[P] ? any : undefined extends C[P] ? never : P]: Extract<C[P], Date> extends never ? Extract<C[P], Record<string, unknown>> extends never ? C[P] : string : any;
|
|
128
|
-
};
|
|
121
|
+
export type TRepositoryCreateOrThings<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.InputOptions<M> = T.InputOptions<M>> = {
|
|
122
|
+
data: TInsertInput<K, C>[];
|
|
129
123
|
where: T.WhereOptions<M>;
|
|
130
124
|
debug?: boolean;
|
|
131
|
-
transaction?: TConnection |
|
|
125
|
+
transaction?: TConnection | TConnection;
|
|
132
126
|
noReturn?: NR;
|
|
133
127
|
};
|
|
134
|
-
export type TRepositoryUpdate<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.
|
|
135
|
-
data:
|
|
136
|
-
[P in K & keyof C]: Extract<C[P], Date> extends never ? Extract<C[P], Record<string, unknown>> extends never ? C[P] : string : any;
|
|
137
|
-
}>;
|
|
128
|
+
export type TRepositoryUpdate<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.InputOptions<M> = T.InputOptions<M>> = {
|
|
129
|
+
data: TUpdateInput<K, C>;
|
|
138
130
|
where: T.WhereOptions<M>;
|
|
139
131
|
debug?: boolean;
|
|
140
|
-
transaction?: TConnection |
|
|
132
|
+
transaction?: TConnection | TConnection;
|
|
141
133
|
noReturn?: NR;
|
|
142
134
|
};
|
|
143
|
-
export type TRepositoryUpdateMultiple<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.
|
|
135
|
+
export type TRepositoryUpdateMultiple<M extends Model<any, any> = Model<any, any>, NR extends boolean | undefined = false, K extends T.ColumnKeys<M> = T.ColumnKeys<M>, C extends T.InputOptions<M> = T.InputOptions<M>> = {
|
|
144
136
|
cases: {
|
|
145
137
|
condition: ((query: M) => M) | Partial<{
|
|
146
138
|
[P in K & keyof C]: Extract<C[P], Date> extends never ? Extract<C[P], Record<string, unknown>> extends never ? C[P] : string : any;
|
|
@@ -150,13 +142,13 @@ export type TRepositoryUpdateMultiple<M extends Model<any, any> = Model<any, any
|
|
|
150
142
|
}>;
|
|
151
143
|
}[];
|
|
152
144
|
debug?: boolean;
|
|
153
|
-
transaction?: TConnection |
|
|
145
|
+
transaction?: TConnection | TConnection;
|
|
154
146
|
noReturn?: NR;
|
|
155
147
|
};
|
|
156
148
|
export type TRepositoryDelete<M extends Model<any, any> = Model<any, any>> = {
|
|
157
149
|
where: T.WhereOptions<M>;
|
|
158
150
|
debug?: boolean;
|
|
159
|
-
transaction?: TConnection |
|
|
151
|
+
transaction?: TConnection | TConnection;
|
|
160
152
|
};
|
|
161
153
|
export type TRepositoryPrimitiveExtendType<T> = T extends NumberConstructor ? number : T extends StringConstructor ? string : T extends BooleanConstructor ? boolean : T extends DateConstructor ? Date : T extends readonly (infer U)[] ? TRepositoryPrimitiveExtendType<U>[] : T extends Record<string, any> ? {
|
|
162
154
|
[K in keyof T]: TRepositoryPrimitiveExtendType<T[K]>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { T } from "..";
|
|
2
|
-
import { TStateWhereCondition } from "../types";
|
|
2
|
+
import type { TStateWhereCondition } from "../types";
|
|
3
3
|
declare const utils: {
|
|
4
4
|
typeOf: (data: any) => string;
|
|
5
5
|
isDate: (data: any) => boolean;
|
|
6
|
-
consoleDebug: (sql?: string, retry?: boolean
|
|
6
|
+
consoleDebug: (sql?: string, retry?: boolean, node?: {
|
|
7
|
+
type: "primary" | "replica";
|
|
8
|
+
node?: number;
|
|
9
|
+
} | null) => void;
|
|
7
10
|
consoleExec: (startTime: number, endTime: number) => void;
|
|
8
11
|
consoleCache: (provider: Record<string, any>) => void;
|
|
9
12
|
faker: (value: string) => string | number | boolean | Date;
|
|
@@ -15,7 +18,7 @@ declare const utils: {
|
|
|
15
18
|
}) => any;
|
|
16
19
|
escapePayload: (v: any) => any;
|
|
17
20
|
escapeXSS: (str: any) => any;
|
|
18
|
-
generateUUID: () => string;
|
|
21
|
+
generateUUID: (version?: 4 | 7) => string;
|
|
19
22
|
transfromBooleanToNumber: (data: any) => any;
|
|
20
23
|
transfromDateToDateString: (data: any) => any;
|
|
21
24
|
snakeCase: (data: any) => any;
|
|
@@ -67,6 +70,7 @@ declare const utils: {
|
|
|
67
70
|
raw: boolean;
|
|
68
71
|
}) => string;
|
|
69
72
|
shallowClone: (value: any) => any;
|
|
73
|
+
sqlFormatted: (sql: string) => string;
|
|
70
74
|
};
|
|
71
75
|
export type TUtils = typeof utils;
|
|
72
76
|
export { utils };
|
package/dist/lib/utils/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.utils = void 0;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const config_1 = require("../config");
|
|
6
7
|
const typeOf = (data) => Object.prototype.toString.apply(data).slice(8, -1).toLocaleLowerCase();
|
|
7
8
|
const isDate = (data) => {
|
|
8
9
|
if (typeOf(data) === 'date')
|
|
@@ -11,31 +12,22 @@ const isDate = (data) => {
|
|
|
11
12
|
};
|
|
12
13
|
const timestamp = (dateString) => {
|
|
13
14
|
const d = dateString == null ? new Date() : new Date(dateString);
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
month,
|
|
23
|
-
date
|
|
24
|
-
].join('-')}`;
|
|
25
|
-
const his = `${[
|
|
26
|
-
hours,
|
|
27
|
-
minutes,
|
|
28
|
-
seconds
|
|
29
|
-
].join(':')}`;
|
|
30
|
-
return `${ymd} ${his}`;
|
|
15
|
+
const isLocal = config_1.Config.TIMEZONE === 'local';
|
|
16
|
+
const year = isLocal ? d.getFullYear() : d.getUTCFullYear();
|
|
17
|
+
const month = `0${(isLocal ? d.getMonth() : d.getUTCMonth()) + 1}`.slice(-2);
|
|
18
|
+
const date = `0${isLocal ? d.getDate() : d.getUTCDate()}`.slice(-2);
|
|
19
|
+
const hours = `0${isLocal ? d.getHours() : d.getUTCHours()}`.slice(-2);
|
|
20
|
+
const minutes = `0${isLocal ? d.getMinutes() : d.getUTCMinutes()}`.slice(-2);
|
|
21
|
+
const seconds = `0${isLocal ? d.getSeconds() : d.getUTCSeconds()}`.slice(-2);
|
|
22
|
+
return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
|
|
31
23
|
};
|
|
32
24
|
const date = (value) => {
|
|
33
25
|
const d = value == null ? new Date() : new Date(value);
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
return
|
|
26
|
+
const isLocal = config_1.Config.TIMEZONE === 'local';
|
|
27
|
+
const year = isLocal ? d.getFullYear() : d.getUTCFullYear();
|
|
28
|
+
const month = `0${(isLocal ? d.getMonth() : d.getUTCMonth()) + 1}`.slice(-2);
|
|
29
|
+
const date = `0${isLocal ? d.getDate() : d.getUTCDate()}`.slice(-2);
|
|
30
|
+
return `${year}-${month}-${date}`;
|
|
39
31
|
};
|
|
40
32
|
const escape = (v, opts = { hard: false }) => {
|
|
41
33
|
if (typeof v !== 'string') {
|
|
@@ -83,13 +75,31 @@ const columnRelation = (name) => {
|
|
|
83
75
|
return `${name.toLocaleLowerCase()}`;
|
|
84
76
|
return name.replace(matches[0], `_${matches[0].toUpperCase()}`);
|
|
85
77
|
};
|
|
86
|
-
const generateUUID = () => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
const generateUUID = (version = 7) => {
|
|
79
|
+
const randomHex = (length) => {
|
|
80
|
+
let result = '';
|
|
81
|
+
for (let i = 0; i < length; i++) {
|
|
82
|
+
result += Math.floor(Math.random() * 16).toString(16);
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
if (version === 4) {
|
|
87
|
+
return [
|
|
88
|
+
randomHex(8),
|
|
89
|
+
randomHex(4),
|
|
90
|
+
`4${randomHex(3)}`,
|
|
91
|
+
`${(8 + Math.floor(Math.random() * 4)).toString(16)}${randomHex(3)}`,
|
|
92
|
+
randomHex(12),
|
|
93
|
+
].join('-');
|
|
94
|
+
}
|
|
95
|
+
const timestamp = Date.now().toString(16).padStart(12, '0');
|
|
96
|
+
return [
|
|
97
|
+
timestamp.slice(0, 8),
|
|
98
|
+
timestamp.slice(8, 12),
|
|
99
|
+
`7${randomHex(3)}`,
|
|
100
|
+
`${(8 + Math.floor(Math.random() * 4)).toString(16)}${randomHex(3)}`,
|
|
101
|
+
randomHex(12),
|
|
102
|
+
].join('-');
|
|
93
103
|
};
|
|
94
104
|
const transfromBooleanToNumber = (data) => {
|
|
95
105
|
if (typeOf(data) === 'boolean')
|
|
@@ -181,7 +191,7 @@ const camelCase = (data) => {
|
|
|
181
191
|
return data;
|
|
182
192
|
}
|
|
183
193
|
};
|
|
184
|
-
const consoleDebug = (sql, retry = false) => {
|
|
194
|
+
const consoleDebug = (sql, retry = false, node) => {
|
|
185
195
|
if (typeof sql !== "string" || sql == null)
|
|
186
196
|
return;
|
|
187
197
|
const colors = {
|
|
@@ -206,11 +216,12 @@ const consoleDebug = (sql, retry = false) => {
|
|
|
206
216
|
.replace(/([`"])(?:\\.|(?!\1).)*\1/g, m => `${colors.special}${m}${colors.reset}`)
|
|
207
217
|
.replace(new RegExp(`\\b(${sqlKeywords.join('|').replace(/ /g, '\\s+')})\\b`, 'g'), (m) => `${colors.keyword}${m}${colors.reset}`);
|
|
208
218
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
219
|
+
const prefix = retry ? 'RETRY QUERY' : 'QUERY';
|
|
220
|
+
const color = retry ? 31 : 34;
|
|
221
|
+
const target = (node
|
|
222
|
+
? `(${node.type}${node.type === 'replica' ? `:${node.node}` : ''})`
|
|
223
|
+
: '');
|
|
224
|
+
console.log(`\n\x1b[${color}m${prefix}${target}:\x1b[0m ${colorSQL(sql.trim())};`);
|
|
214
225
|
};
|
|
215
226
|
const consoleExec = (startTime, endTime) => {
|
|
216
227
|
const diffInMilliseconds = endTime - startTime;
|
|
@@ -314,9 +325,11 @@ const softNumber = (n) => {
|
|
|
314
325
|
if (number === -1) {
|
|
315
326
|
return 2 ** 31 - 1; // int 32 bit
|
|
316
327
|
}
|
|
328
|
+
;
|
|
317
329
|
if (Number.isNaN(number)) {
|
|
318
|
-
return
|
|
330
|
+
return 0;
|
|
319
331
|
}
|
|
332
|
+
;
|
|
320
333
|
return Number.parseInt(`${number}`);
|
|
321
334
|
};
|
|
322
335
|
const checkValueHasRaw = (value) => {
|
|
@@ -521,6 +534,54 @@ const shallowClone = (value) => {
|
|
|
521
534
|
}
|
|
522
535
|
return value;
|
|
523
536
|
};
|
|
537
|
+
const sqlFormatted = (sql) => {
|
|
538
|
+
const statements = sql
|
|
539
|
+
.split(";")
|
|
540
|
+
.map((s) => s.trim())
|
|
541
|
+
.filter(Boolean);
|
|
542
|
+
const formattedStatements = statements.map((stmt) => {
|
|
543
|
+
if (stmt.includes("(")) {
|
|
544
|
+
const firstParen = stmt.indexOf("(");
|
|
545
|
+
const lastParen = stmt.lastIndexOf(")");
|
|
546
|
+
if (firstParen === -1 || lastParen === -1)
|
|
547
|
+
return stmt + ";";
|
|
548
|
+
const prefix = stmt.slice(0, firstParen).trim();
|
|
549
|
+
let columnsPart = stmt.slice(firstParen + 1, lastParen).trim();
|
|
550
|
+
const colArray = [];
|
|
551
|
+
let parenCount = 0;
|
|
552
|
+
let start = 0;
|
|
553
|
+
for (let i = 0; i < columnsPart.length; i++) {
|
|
554
|
+
const char = columnsPart[i];
|
|
555
|
+
if (char === "(")
|
|
556
|
+
parenCount++;
|
|
557
|
+
if (char === ")")
|
|
558
|
+
parenCount--;
|
|
559
|
+
if (char === "," && parenCount === 0) {
|
|
560
|
+
colArray.push(columnsPart.slice(start, i).trim());
|
|
561
|
+
start = i + 1;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
colArray.push(columnsPart.slice(start).trim());
|
|
565
|
+
const seen = new Set();
|
|
566
|
+
const uniqueColumns = colArray.filter((col) => {
|
|
567
|
+
const colNameMatch = col.match(/"([\w]+)"/) || col.match(/([\w]+)/);
|
|
568
|
+
const colName = colNameMatch ? colNameMatch[1] : col;
|
|
569
|
+
if (seen.has(colName))
|
|
570
|
+
return false;
|
|
571
|
+
seen.add(colName);
|
|
572
|
+
return true;
|
|
573
|
+
});
|
|
574
|
+
const formattedColumns = uniqueColumns
|
|
575
|
+
.map((c) => " " + c)
|
|
576
|
+
.join(",\n");
|
|
577
|
+
return `${prefix} (\n${formattedColumns}\n)`;
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
return stmt;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
return formattedStatements.join(";\n\n");
|
|
584
|
+
};
|
|
524
585
|
const utils = {
|
|
525
586
|
typeOf,
|
|
526
587
|
isDate,
|
|
@@ -555,7 +616,8 @@ const utils = {
|
|
|
555
616
|
nestConditions,
|
|
556
617
|
formatQueryValue,
|
|
557
618
|
bindingParameters,
|
|
558
|
-
shallowClone
|
|
619
|
+
shallowClone,
|
|
620
|
+
sqlFormatted
|
|
559
621
|
};
|
|
560
622
|
exports.utils = utils;
|
|
561
623
|
exports.default = utils;
|