tspace-mysql 1.9.0 → 1.9.1
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 +4357 -133
- package/dist/lib/config/index.d.ts +2 -2
- package/dist/lib/config/index.js +24 -16
- package/dist/lib/config/index.js.map +1 -1
- package/dist/lib/constants/index.d.ts +10 -1
- package/dist/lib/constants/index.js +11 -2
- package/dist/lib/constants/index.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractBuilder.d.ts +11 -7
- package/dist/lib/core/Abstracts/AbstractBuilder.js +11 -13
- package/dist/lib/core/Abstracts/AbstractBuilder.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractDB.d.ts +4 -1
- package/dist/lib/core/Abstracts/AbstractDB.js.map +1 -1
- package/dist/lib/core/Abstracts/AbstractView.js.map +1 -1
- package/dist/lib/core/Blueprint.d.ts +30 -10
- package/dist/lib/core/Blueprint.js +39 -14
- package/dist/lib/core/Blueprint.js.map +1 -1
- package/dist/lib/core/Builder.d.ts +263 -9
- package/dist/lib/core/Builder.js +610 -347
- package/dist/lib/core/Builder.js.map +1 -1
- package/dist/lib/core/Cache/DBCache.js +19 -20
- package/dist/lib/core/Cache/DBCache.js.map +1 -1
- package/dist/lib/core/Cache/MemoryCache.js +3 -3
- package/dist/lib/core/Cache/MemoryCache.js.map +1 -1
- package/dist/lib/core/Cache/RedisCache.js +27 -17
- package/dist/lib/core/Cache/RedisCache.js.map +1 -1
- package/dist/lib/core/Cache/index.js +5 -4
- package/dist/lib/core/Cache/index.js.map +1 -1
- package/dist/lib/core/Contracts/AlterTable.d.ts +152 -0
- package/dist/lib/core/Contracts/AlterTable.js +243 -0
- package/dist/lib/core/Contracts/AlterTable.js.map +1 -0
- package/dist/lib/core/Contracts/Audit.js +2 -5
- package/dist/lib/core/Contracts/Audit.js.map +1 -1
- package/dist/lib/core/DB.d.ts +101 -9
- package/dist/lib/core/DB.js +168 -29
- package/dist/lib/core/DB.js.map +1 -1
- package/dist/lib/core/Decorator.d.ts +144 -16
- package/dist/lib/core/Decorator.js +156 -14
- package/dist/lib/core/Decorator.js.map +1 -1
- package/dist/lib/core/Driver/index.d.ts +43 -9
- package/dist/lib/core/Driver/index.js +9 -7
- package/dist/lib/core/Driver/index.js.map +1 -1
- package/dist/lib/core/Driver/mariadb/MariadbDriver.js +74 -27
- package/dist/lib/core/Driver/mariadb/MariadbDriver.js.map +1 -1
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.d.ts +45 -9
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.js +165 -21
- package/dist/lib/core/Driver/mariadb/MariadbQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/mongodb/MongodbDriver.d.ts +24 -0
- package/dist/lib/core/Driver/mongodb/MongodbDriver.js +255 -0
- package/dist/lib/core/Driver/mongodb/MongodbDriver.js.map +1 -0
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.d.ts +141 -0
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.js +563 -0
- package/dist/lib/core/Driver/mongodb/MongodbQueryBuilder.js.map +1 -0
- package/dist/lib/core/Driver/mysql/MysqlDriver.js +105 -95
- package/dist/lib/core/Driver/mysql/MysqlDriver.js.map +1 -1
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.d.ts +45 -9
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.js +165 -21
- package/dist/lib/core/Driver/mysql/MysqlQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/postgres/PostgresDriver.js +97 -72
- package/dist/lib/core/Driver/postgres/PostgresDriver.js.map +1 -1
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.d.ts +50 -9
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.js +296 -41
- package/dist/lib/core/Driver/postgres/PostgresQueryBuilder.js.map +1 -1
- package/dist/lib/core/Driver/sqlite/SqliteDriver.d.ts +20 -0
- package/dist/lib/core/Driver/sqlite/SqliteDriver.js +192 -0
- package/dist/lib/core/Driver/sqlite/SqliteDriver.js.map +1 -0
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.d.ts +144 -0
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.js +689 -0
- package/dist/lib/core/Driver/sqlite/SqliteQueryBuilder.js.map +1 -0
- package/dist/lib/core/JoinModel.js +2 -2
- package/dist/lib/core/JoinModel.js.map +1 -1
- package/dist/lib/core/Meta.d.ts +17 -11
- package/dist/lib/core/Meta.js +25 -19
- package/dist/lib/core/Meta.js.map +1 -1
- package/dist/lib/core/Model.d.ts +450 -108
- package/dist/lib/core/Model.js +1031 -587
- package/dist/lib/core/Model.js.map +1 -1
- package/dist/lib/{tools/index.d.ts → core/Package.d.ts} +11 -3
- package/dist/lib/{tools/index.js → core/Package.js} +20 -7
- package/dist/lib/core/Package.js.map +1 -0
- package/dist/lib/core/Pool.js +42 -30
- package/dist/lib/core/Pool.js.map +1 -1
- package/dist/lib/core/Queue.d.ts +240 -0
- package/dist/lib/core/Queue.js +686 -0
- package/dist/lib/core/Queue.js.map +1 -0
- package/dist/lib/core/RelationManager.js +27 -25
- package/dist/lib/core/RelationManager.js.map +1 -1
- package/dist/lib/core/Repository.d.ts +73 -207
- package/dist/lib/core/Repository.js +120 -235
- package/dist/lib/core/Repository.js.map +1 -1
- package/dist/lib/core/Schema.d.ts +218 -0
- package/dist/lib/core/Schema.js +370 -65
- package/dist/lib/core/Schema.js.map +1 -1
- package/dist/lib/core/StateManager.d.ts +25 -12
- package/dist/lib/core/StateManager.js +10 -5
- package/dist/lib/core/StateManager.js.map +1 -1
- package/dist/lib/core/UtilityTypes.d.ts +85 -56
- package/dist/lib/core/UtilityTypes.js.map +1 -1
- package/dist/lib/core/index.d.ts +4 -0
- package/dist/lib/core/index.js +6 -2
- package/dist/lib/core/index.js.map +1 -1
- package/dist/lib/types/decorator/index.d.ts +1 -1
- package/dist/lib/types/index.d.ts +69 -22
- package/dist/lib/types/repository/index.d.ts +68 -37
- package/dist/lib/utils/index.d.ts +11 -1
- package/dist/lib/utils/index.js +58 -2
- package/dist/lib/utils/index.js.map +1 -1
- package/package.json +14 -6
- package/dist/lib/tools/index.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
+
import { Model } from "./Model";
|
|
2
3
|
import { Blueprint } from "./Blueprint";
|
|
3
4
|
import type { TRelationOptionsDecorator } from "../types/decorator";
|
|
4
5
|
import type { TPattern, TValidateSchemaDecorator } from "../types";
|
|
5
|
-
|
|
6
|
+
type RelationOptions = TRelationOptionsDecorator;
|
|
6
7
|
export declare const REFLECT_META: {
|
|
7
8
|
RELATIONS: {
|
|
8
9
|
hasOne: string;
|
|
@@ -204,8 +205,8 @@ export declare const Column: (blueprint: () => Blueprint) => Function;
|
|
|
204
205
|
* for a property. Useful for serialization/deserialization logic (e.g. ORM, DTO).
|
|
205
206
|
*
|
|
206
207
|
* @param {Object} options - Transform options.
|
|
207
|
-
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* database
|
|
208
|
-
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database
|
|
208
|
+
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* app -> database.
|
|
209
|
+
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database -> app.
|
|
209
210
|
* @returns {Function} A property decorator that stores transform metadata.
|
|
210
211
|
*
|
|
211
212
|
* @throws {Error} If the property name cannot be determined.
|
|
@@ -267,7 +268,7 @@ export declare const Validate: (validate: TValidateSchemaDecorator) => Function;
|
|
|
267
268
|
/**
|
|
268
269
|
* Decorator to define a HasOne relationship on a model property.
|
|
269
270
|
*
|
|
270
|
-
* @param {
|
|
271
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
271
272
|
* @returns {Function} A decorator that registers the HasOne relationship.
|
|
272
273
|
*
|
|
273
274
|
* @example
|
|
@@ -281,11 +282,11 @@ export declare const Validate: (validate: TValidateSchemaDecorator) => Function;
|
|
|
281
282
|
*
|
|
282
283
|
* ```
|
|
283
284
|
*/
|
|
284
|
-
export declare const HasOne: (fn: (() => new () => Model) |
|
|
285
|
+
export declare const HasOne: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
285
286
|
/**
|
|
286
287
|
* Decorator to define a HasMany relationship on a model property.
|
|
287
288
|
*
|
|
288
|
-
* @param {
|
|
289
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
289
290
|
* @returns {Function} A decorator that registers the HasMany relationship.
|
|
290
291
|
*
|
|
291
292
|
* @example
|
|
@@ -299,11 +300,11 @@ export declare const HasOne: (fn: (() => new () => Model) | TRelationOptionsDeco
|
|
|
299
300
|
*
|
|
300
301
|
* ```
|
|
301
302
|
*/
|
|
302
|
-
export declare const HasMany: (fn: (() => new () => Model) |
|
|
303
|
+
export declare const HasMany: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
303
304
|
/**
|
|
304
305
|
* Decorator to define a BelongsTo relationship on a model property.
|
|
305
306
|
*
|
|
306
|
-
* @param {
|
|
307
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
307
308
|
* @returns {Function} A decorator that registers the BelongsTo relationship.
|
|
308
309
|
*
|
|
309
310
|
* @example
|
|
@@ -317,11 +318,11 @@ export declare const HasMany: (fn: (() => new () => Model) | TRelationOptionsDec
|
|
|
317
318
|
*
|
|
318
319
|
* ```
|
|
319
320
|
*/
|
|
320
|
-
export declare const BelongsTo: (fn: (() => new () => Model) |
|
|
321
|
+
export declare const BelongsTo: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
321
322
|
/**
|
|
322
323
|
* Decorator to define a BelongsToMany (many-to-many) relationship on a model property.
|
|
323
324
|
*
|
|
324
|
-
* @param {
|
|
325
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
325
326
|
* @returns {Function} A decorator that registers the BelongsToMany relationship.
|
|
326
327
|
*
|
|
327
328
|
* @example
|
|
@@ -335,7 +336,7 @@ export declare const BelongsTo: (fn: (() => new () => Model) | TRelationOptionsD
|
|
|
335
336
|
*
|
|
336
337
|
* ```
|
|
337
338
|
*/
|
|
338
|
-
export declare const BelongsToMany: (fn: (() => new () => Model) |
|
|
339
|
+
export declare const BelongsToMany: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
339
340
|
/**
|
|
340
341
|
* Decorator to attach an observer class to a model.
|
|
341
342
|
*
|
|
@@ -514,6 +515,20 @@ export declare const D: {
|
|
|
514
515
|
TableSingular: () => ClassDecorator;
|
|
515
516
|
TablePlural: () => ClassDecorator;
|
|
516
517
|
UUID: (column?: string) => ClassDecorator;
|
|
518
|
+
/**
|
|
519
|
+
* Decorator to enable automatic timestamps on a model.
|
|
520
|
+
*
|
|
521
|
+
* Stores metadata indicating that `createdAt` and `updatedAt` columns should be handled.
|
|
522
|
+
*
|
|
523
|
+
* @param {{ createdAt: string; updatedAt: string }} [columns] - Optional custom column names for timestamps.
|
|
524
|
+
* @returns {ClassDecorator} A class decorator that enables timestamp metadata.
|
|
525
|
+
*
|
|
526
|
+
* @example
|
|
527
|
+
* ```ts
|
|
528
|
+
* @Timestamp({ createdAt: 'created_at', updatedAt: 'updated_at' })
|
|
529
|
+
* class User extends Model {}
|
|
530
|
+
* ```
|
|
531
|
+
*/
|
|
517
532
|
SoftDelete: (column?: string) => ClassDecorator;
|
|
518
533
|
Timestamp: (columns?: {
|
|
519
534
|
createdAt: string;
|
|
@@ -522,23 +537,135 @@ export declare const D: {
|
|
|
522
537
|
Pattern: (pattern: TPattern) => ClassDecorator;
|
|
523
538
|
CamelCase: () => ClassDecorator;
|
|
524
539
|
SnakeCase: () => ClassDecorator;
|
|
540
|
+
/**
|
|
541
|
+
* Decorator to define a database column for a model property.
|
|
542
|
+
*
|
|
543
|
+
* Accepts a `Blueprint` function that defines the column type, constraints, and other attributes.
|
|
544
|
+
* The resulting column schema is stored as metadata on the target class.
|
|
545
|
+
*
|
|
546
|
+
* @param {() => Blueprint} blueprint - A function returning a `Blueprint` instance describing the column.
|
|
547
|
+
* @returns {Function} A property decorator that registers the column schema.
|
|
548
|
+
*
|
|
549
|
+
* @throws {Error} If the property name cannot be determined.
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* ```ts
|
|
553
|
+
* class User extends Model {
|
|
554
|
+
*
|
|
555
|
+
* @Column(() => Blueprint.int().notNull().primary().autoIncrement())
|
|
556
|
+
* public id!: number;
|
|
557
|
+
*
|
|
558
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
559
|
+
* public uuid!: string;
|
|
560
|
+
* }
|
|
561
|
+
*
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
525
564
|
Column: (blueprint: () => Blueprint) => Function;
|
|
565
|
+
/**
|
|
566
|
+
* Decorator to attach validation rules to a model property.
|
|
567
|
+
*
|
|
568
|
+
* Accepts a `TValidateSchemaDecorator` object describing the validation rules
|
|
569
|
+
* (e.g., type, required, length, regex match, uniqueness, or custom validation function).
|
|
570
|
+
* The validation schema is stored as metadata on the target class.
|
|
571
|
+
*
|
|
572
|
+
* @param {TValidateSchemaDecorator} validate - An object defining validation rules for the property.
|
|
573
|
+
* @returns {Function} A decorator that registers the validation schema.
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```ts
|
|
577
|
+
* class User extends Model {
|
|
578
|
+
*
|
|
579
|
+
* @Column(() => Blueprint.int().notNull().primary().autoIncrement())
|
|
580
|
+
* public id!: number;
|
|
581
|
+
*
|
|
582
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
583
|
+
* public uuid!: string;
|
|
584
|
+
*
|
|
585
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
586
|
+
* @Validate({
|
|
587
|
+
* type: String,
|
|
588
|
+
* require: true,
|
|
589
|
+
* length: 50,
|
|
590
|
+
* match: /^[a-zA-Z0-9._]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
591
|
+
* unique: true,
|
|
592
|
+
* fn: async (email: string) => {
|
|
593
|
+
* const exists = await new User().where('email',email).exists();
|
|
594
|
+
* if(exists) return `This column "${email}" is dupicate`;
|
|
595
|
+
* return null;
|
|
596
|
+
* }
|
|
597
|
+
* })
|
|
598
|
+
* public email!: string;
|
|
599
|
+
* }
|
|
600
|
+
*
|
|
601
|
+
* ```
|
|
602
|
+
*/
|
|
526
603
|
Validate: (validate: TValidateSchemaDecorator) => Function;
|
|
527
|
-
HasOne: (fn: (() => new () => Model) |
|
|
528
|
-
HasMany: (fn: (() => new () => Model) |
|
|
529
|
-
BelongsTo: (fn: (() => new () => Model) |
|
|
530
|
-
BelongsToMany: (fn: (() => new () => Model) |
|
|
604
|
+
HasOne: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
605
|
+
HasMany: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
606
|
+
BelongsTo: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
607
|
+
BelongsToMany: (fn: (() => new () => Model) | RelationOptions) => Function;
|
|
608
|
+
/**
|
|
609
|
+
* A decorator factory that registers custom `to` and `from` transform functions
|
|
610
|
+
* for a property. Useful for serialization/deserialization logic (e.g. ORM, DTO).
|
|
611
|
+
*
|
|
612
|
+
* @param {Object} options - Transform options.
|
|
613
|
+
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* app -> database.
|
|
614
|
+
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database -> app.
|
|
615
|
+
* @returns {Function} A property decorator that stores transform metadata.
|
|
616
|
+
*
|
|
617
|
+
* @throws {Error} If the property name cannot be determined.
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* ```ts
|
|
621
|
+
* class User {
|
|
622
|
+
* @Transform({
|
|
623
|
+
* to: (v) => JSON.stringify(v),
|
|
624
|
+
* from: (v) => JSON.parse(v),
|
|
625
|
+
* })
|
|
626
|
+
* profile;
|
|
627
|
+
* }
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
531
630
|
Transform: ({ to, from }: {
|
|
532
631
|
to: (value: unknown) => any | Promise<any>;
|
|
533
632
|
from: (value: unknown) => any | Promise<any>;
|
|
534
633
|
}) => Function;
|
|
634
|
+
/**
|
|
635
|
+
* Decorator that registers a method as a generic lifecycle hook.
|
|
636
|
+
* Unlike specific hooks such as `@BeforeInsert` or `@AfterUpdate`,
|
|
637
|
+
* this decorator is **multi-purpose** and collects all tagged methods
|
|
638
|
+
* into a single metadata registry (`REFLECT_META.HOOKS`).
|
|
639
|
+
*
|
|
640
|
+
* These hook methods can later be invoked by the ORM/engine at any stage
|
|
641
|
+
* depending on your custom logic.
|
|
642
|
+
*
|
|
643
|
+
* @returns {Function} A method decorator.
|
|
644
|
+
*
|
|
645
|
+
* @throws {Error} If applied to a non-method class member.
|
|
646
|
+
*
|
|
647
|
+
* @example
|
|
648
|
+
* ```ts
|
|
649
|
+
* class User {
|
|
650
|
+
* @Hooks()
|
|
651
|
+
* logAction() {
|
|
652
|
+
* console.log("A lifecycle action happened");
|
|
653
|
+
* }
|
|
654
|
+
* }
|
|
655
|
+
* ```
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* // Later, your ORM engine could do:
|
|
659
|
+
* const hooks = Reflect.getMetadata(REFLECT_META.HOOKS, userInstance) || [];
|
|
660
|
+
* for (const hook of hooks) hook.call(userInstance);
|
|
661
|
+
*/
|
|
662
|
+
Hooks: () => Function;
|
|
535
663
|
Observer: (observer: new () => {
|
|
536
664
|
selected: Function;
|
|
537
665
|
created: Function;
|
|
538
666
|
updated: Function;
|
|
539
667
|
deleted: Function;
|
|
540
668
|
}) => ClassDecorator;
|
|
541
|
-
Hooks: () => Function;
|
|
542
669
|
BeforeInsert: () => Function;
|
|
543
670
|
BeforeUpdate: () => Function;
|
|
544
671
|
BeforeRemove: () => Function;
|
|
@@ -546,3 +673,4 @@ export declare const D: {
|
|
|
546
673
|
AfterUpdate: () => Function;
|
|
547
674
|
AfterRemove: () => Function;
|
|
548
675
|
};
|
|
676
|
+
export {};
|
|
@@ -272,8 +272,8 @@ exports.Column = Column;
|
|
|
272
272
|
* for a property. Useful for serialization/deserialization logic (e.g. ORM, DTO).
|
|
273
273
|
*
|
|
274
274
|
* @param {Object} options - Transform options.
|
|
275
|
-
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* database
|
|
276
|
-
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database
|
|
275
|
+
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* app -> database.
|
|
276
|
+
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database -> app.
|
|
277
277
|
* @returns {Function} A property decorator that stores transform metadata.
|
|
278
278
|
*
|
|
279
279
|
* @throws {Error} If the property name cannot be determined.
|
|
@@ -353,7 +353,7 @@ exports.Validate = Validate;
|
|
|
353
353
|
/**
|
|
354
354
|
* Decorator to define a HasOne relationship on a model property.
|
|
355
355
|
*
|
|
356
|
-
* @param {
|
|
356
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
357
357
|
* @returns {Function} A decorator that registers the HasOne relationship.
|
|
358
358
|
*
|
|
359
359
|
* @example
|
|
@@ -382,7 +382,7 @@ exports.HasOne = HasOne;
|
|
|
382
382
|
/**
|
|
383
383
|
* Decorator to define a HasMany relationship on a model property.
|
|
384
384
|
*
|
|
385
|
-
* @param {
|
|
385
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
386
386
|
* @returns {Function} A decorator that registers the HasMany relationship.
|
|
387
387
|
*
|
|
388
388
|
* @example
|
|
@@ -411,7 +411,7 @@ exports.HasMany = HasMany;
|
|
|
411
411
|
/**
|
|
412
412
|
* Decorator to define a BelongsTo relationship on a model property.
|
|
413
413
|
*
|
|
414
|
-
* @param {
|
|
414
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
415
415
|
* @returns {Function} A decorator that registers the BelongsTo relationship.
|
|
416
416
|
*
|
|
417
417
|
* @example
|
|
@@ -440,7 +440,7 @@ exports.BelongsTo = BelongsTo;
|
|
|
440
440
|
/**
|
|
441
441
|
* Decorator to define a BelongsToMany (many-to-many) relationship on a model property.
|
|
442
442
|
*
|
|
443
|
-
* @param {
|
|
443
|
+
* @param {RelationOptions} options - Options describing the relation.
|
|
444
444
|
* @returns {Function} A decorator that registers the BelongsToMany relationship.
|
|
445
445
|
*
|
|
446
446
|
* @example
|
|
@@ -759,15 +759,157 @@ exports.AfterRemove = AfterRemove;
|
|
|
759
759
|
* @namespace D
|
|
760
760
|
*/
|
|
761
761
|
exports.D = {
|
|
762
|
-
Table: exports.Table,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
762
|
+
Table: exports.Table,
|
|
763
|
+
TableSingular: exports.TableSingular,
|
|
764
|
+
TablePlural: exports.TablePlural,
|
|
765
|
+
UUID: exports.UUID,
|
|
766
|
+
/**
|
|
767
|
+
* Decorator to enable automatic timestamps on a model.
|
|
768
|
+
*
|
|
769
|
+
* Stores metadata indicating that `createdAt` and `updatedAt` columns should be handled.
|
|
770
|
+
*
|
|
771
|
+
* @param {{ createdAt: string; updatedAt: string }} [columns] - Optional custom column names for timestamps.
|
|
772
|
+
* @returns {ClassDecorator} A class decorator that enables timestamp metadata.
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* ```ts
|
|
776
|
+
* @Timestamp({ createdAt: 'created_at', updatedAt: 'updated_at' })
|
|
777
|
+
* class User extends Model {}
|
|
778
|
+
* ```
|
|
779
|
+
*/
|
|
780
|
+
SoftDelete: exports.SoftDelete,
|
|
781
|
+
Timestamp: exports.Timestamp,
|
|
782
|
+
Pattern: exports.Pattern,
|
|
783
|
+
CamelCase: exports.CamelCase,
|
|
784
|
+
SnakeCase: exports.SnakeCase,
|
|
785
|
+
/**
|
|
786
|
+
* Decorator to define a database column for a model property.
|
|
787
|
+
*
|
|
788
|
+
* Accepts a `Blueprint` function that defines the column type, constraints, and other attributes.
|
|
789
|
+
* The resulting column schema is stored as metadata on the target class.
|
|
790
|
+
*
|
|
791
|
+
* @param {() => Blueprint} blueprint - A function returning a `Blueprint` instance describing the column.
|
|
792
|
+
* @returns {Function} A property decorator that registers the column schema.
|
|
793
|
+
*
|
|
794
|
+
* @throws {Error} If the property name cannot be determined.
|
|
795
|
+
*
|
|
796
|
+
* @example
|
|
797
|
+
* ```ts
|
|
798
|
+
* class User extends Model {
|
|
799
|
+
*
|
|
800
|
+
* @Column(() => Blueprint.int().notNull().primary().autoIncrement())
|
|
801
|
+
* public id!: number;
|
|
802
|
+
*
|
|
803
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
804
|
+
* public uuid!: string;
|
|
805
|
+
* }
|
|
806
|
+
*
|
|
807
|
+
* ```
|
|
808
|
+
*/
|
|
809
|
+
Column: exports.Column,
|
|
810
|
+
/**
|
|
811
|
+
* Decorator to attach validation rules to a model property.
|
|
812
|
+
*
|
|
813
|
+
* Accepts a `TValidateSchemaDecorator` object describing the validation rules
|
|
814
|
+
* (e.g., type, required, length, regex match, uniqueness, or custom validation function).
|
|
815
|
+
* The validation schema is stored as metadata on the target class.
|
|
816
|
+
*
|
|
817
|
+
* @param {TValidateSchemaDecorator} validate - An object defining validation rules for the property.
|
|
818
|
+
* @returns {Function} A decorator that registers the validation schema.
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* ```ts
|
|
822
|
+
* class User extends Model {
|
|
823
|
+
*
|
|
824
|
+
* @Column(() => Blueprint.int().notNull().primary().autoIncrement())
|
|
825
|
+
* public id!: number;
|
|
826
|
+
*
|
|
827
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
828
|
+
* public uuid!: string;
|
|
829
|
+
*
|
|
830
|
+
* @Column(() => Blueprint.varchar(50).null())
|
|
831
|
+
* @Validate({
|
|
832
|
+
* type: String,
|
|
833
|
+
* require: true,
|
|
834
|
+
* length: 50,
|
|
835
|
+
* match: /^[a-zA-Z0-9._]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
836
|
+
* unique: true,
|
|
837
|
+
* fn: async (email: string) => {
|
|
838
|
+
* const exists = await new User().where('email',email).exists();
|
|
839
|
+
* if(exists) return `This column "${email}" is dupicate`;
|
|
840
|
+
* return null;
|
|
841
|
+
* }
|
|
842
|
+
* })
|
|
843
|
+
* public email!: string;
|
|
844
|
+
* }
|
|
845
|
+
*
|
|
846
|
+
* ```
|
|
847
|
+
*/
|
|
848
|
+
Validate: exports.Validate,
|
|
766
849
|
// ------- Relations --------
|
|
767
|
-
HasOne: exports.HasOne,
|
|
850
|
+
HasOne: exports.HasOne,
|
|
851
|
+
HasMany: exports.HasMany,
|
|
852
|
+
BelongsTo: exports.BelongsTo,
|
|
853
|
+
BelongsToMany: exports.BelongsToMany,
|
|
768
854
|
// ------- Hook -------------
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
855
|
+
/**
|
|
856
|
+
* A decorator factory that registers custom `to` and `from` transform functions
|
|
857
|
+
* for a property. Useful for serialization/deserialization logic (e.g. ORM, DTO).
|
|
858
|
+
*
|
|
859
|
+
* @param {Object} options - Transform options.
|
|
860
|
+
* @param {(value: unknown) => any | Promise<any>} options.to - Function executed when transforming *to* app -> database.
|
|
861
|
+
* @param {(value: unknown) => any | Promise<any>} options.from - Function executed when transforming *from* database -> app.
|
|
862
|
+
* @returns {Function} A property decorator that stores transform metadata.
|
|
863
|
+
*
|
|
864
|
+
* @throws {Error} If the property name cannot be determined.
|
|
865
|
+
*
|
|
866
|
+
* @example
|
|
867
|
+
* ```ts
|
|
868
|
+
* class User {
|
|
869
|
+
* @Transform({
|
|
870
|
+
* to: (v) => JSON.stringify(v),
|
|
871
|
+
* from: (v) => JSON.parse(v),
|
|
872
|
+
* })
|
|
873
|
+
* profile;
|
|
874
|
+
* }
|
|
875
|
+
* ```
|
|
876
|
+
*/
|
|
877
|
+
Transform: exports.Transform,
|
|
878
|
+
/**
|
|
879
|
+
* Decorator that registers a method as a generic lifecycle hook.
|
|
880
|
+
* Unlike specific hooks such as `@BeforeInsert` or `@AfterUpdate`,
|
|
881
|
+
* this decorator is **multi-purpose** and collects all tagged methods
|
|
882
|
+
* into a single metadata registry (`REFLECT_META.HOOKS`).
|
|
883
|
+
*
|
|
884
|
+
* These hook methods can later be invoked by the ORM/engine at any stage
|
|
885
|
+
* depending on your custom logic.
|
|
886
|
+
*
|
|
887
|
+
* @returns {Function} A method decorator.
|
|
888
|
+
*
|
|
889
|
+
* @throws {Error} If applied to a non-method class member.
|
|
890
|
+
*
|
|
891
|
+
* @example
|
|
892
|
+
* ```ts
|
|
893
|
+
* class User {
|
|
894
|
+
* @Hooks()
|
|
895
|
+
* logAction() {
|
|
896
|
+
* console.log("A lifecycle action happened");
|
|
897
|
+
* }
|
|
898
|
+
* }
|
|
899
|
+
* ```
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* // Later, your ORM engine could do:
|
|
903
|
+
* const hooks = Reflect.getMetadata(REFLECT_META.HOOKS, userInstance) || [];
|
|
904
|
+
* for (const hook of hooks) hook.call(userInstance);
|
|
905
|
+
*/
|
|
906
|
+
Hooks: exports.Hooks,
|
|
907
|
+
Observer: exports.Observer,
|
|
908
|
+
BeforeInsert: exports.BeforeInsert,
|
|
909
|
+
BeforeUpdate: exports.BeforeUpdate,
|
|
910
|
+
BeforeRemove: exports.BeforeRemove,
|
|
911
|
+
AfterInsert: exports.AfterInsert,
|
|
912
|
+
AfterUpdate: exports.AfterUpdate,
|
|
913
|
+
AfterRemove: exports.AfterRemove
|
|
772
914
|
};
|
|
773
915
|
//# sourceMappingURL=Decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decorator.js","sourceRoot":"","sources":["../../../src/lib/core/Decorator.ts"],"names":[],"mappings":";;;;;;AAAA,4BAA0B;AAC1B,0DAAuC;AAY1B,QAAA,YAAY,GAAG;IAC1B,SAAS,EAAG;QACV,MAAM,EAAU,iBAAiB;QACjC,OAAO,EAAS,kBAAkB;QAClC,SAAS,EAAO,oBAAoB;QACpC,aAAa,EAAG,w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AU;IACV,SAAS,EAAT,iBAAS;IACT,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,SAAS,EAAT,iBAAS;IAET;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,EAAN,cAAM;IAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,QAAQ,EAAR,gBAAQ;IAER,6BAA6B;IAC7B,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,aAAa,EAAb,qBAAa;IAEb,6BAA6B;IAE7B;;;;;;;;;;;;;;;;;;;;;KAqBC;IACD,SAAS,EAAT,iBAAS;IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,EAAL,aAAK;IAEL,QAAQ,EAAR,gBAAQ;IACR,YAAY,EAAZ,oBAAY;IACZ,YAAY,EAAZ,oBAAY;IACZ,YAAY,EAAZ,oBAAY;IACZ,WAAW,EAAX,mBAAW;IACX,WAAW,EAAX,mBAAW;IACX,WAAW,EAAX,mBAAW;CACZ,CAAA"}
|
|
@@ -6,7 +6,9 @@ export declare abstract class BaseDriver extends EventEmitter {
|
|
|
6
6
|
private SLOW_QUERY_EXECUTE_TIME;
|
|
7
7
|
private SLOW_QUERY_LIMIT_LENGTH;
|
|
8
8
|
protected pool: any;
|
|
9
|
+
protected poolTrx: any;
|
|
9
10
|
protected options: Record<string, any>;
|
|
11
|
+
protected MESSAGE_TRX_NOT_STARTED: string;
|
|
10
12
|
protected MESSAGE_TRX_CLOSED: string;
|
|
11
13
|
protected abstract connect(): TPoolConnected;
|
|
12
14
|
protected abstract disconnect(pool: any): void;
|
|
@@ -18,7 +20,7 @@ export declare abstract class BaseDriver extends EventEmitter {
|
|
|
18
20
|
sql: string;
|
|
19
21
|
}): void;
|
|
20
22
|
protected _messageSlowQuery(duration: number, sql: string): string;
|
|
21
|
-
protected _detectQueryType(query: string): "" | "
|
|
23
|
+
protected _detectQueryType(query: string): "SELECT" | "UPDATE" | "DELETE" | "INSERT" | "UNKNOWN";
|
|
22
24
|
protected _onPoolConnect(pool: any): void;
|
|
23
25
|
protected _messageConnected(message: string): string;
|
|
24
26
|
protected _messageError(message: string): string;
|
|
@@ -41,10 +43,11 @@ export declare abstract class QueryBuilder {
|
|
|
41
43
|
table: string;
|
|
42
44
|
}): string;
|
|
43
45
|
abstract getTables(database: string): string;
|
|
44
|
-
abstract
|
|
46
|
+
abstract hasTable({ database, table, }: {
|
|
45
47
|
database: string;
|
|
46
48
|
table: string;
|
|
47
49
|
}): string;
|
|
50
|
+
abstract createDatabase(database: string): string;
|
|
48
51
|
abstract createTable({ database, table, schema, }: {
|
|
49
52
|
database: string;
|
|
50
53
|
table: string;
|
|
@@ -80,7 +83,7 @@ export declare abstract class QueryBuilder {
|
|
|
80
83
|
table: string;
|
|
81
84
|
constraint: string;
|
|
82
85
|
}): string;
|
|
83
|
-
abstract
|
|
86
|
+
abstract addFK({ table, tableRef, key, constraint, foreign, }: {
|
|
84
87
|
table: string;
|
|
85
88
|
tableRef: string;
|
|
86
89
|
key: string;
|
|
@@ -91,19 +94,48 @@ export declare abstract class QueryBuilder {
|
|
|
91
94
|
onUpdate: string;
|
|
92
95
|
};
|
|
93
96
|
}): string;
|
|
94
|
-
abstract getIndexes({ database, table }: {
|
|
97
|
+
abstract getIndexes({ database, table, }: {
|
|
95
98
|
database: string;
|
|
96
99
|
table: string;
|
|
97
100
|
}): string;
|
|
98
|
-
abstract hasIndex({ database, table,
|
|
101
|
+
abstract hasIndex({ database, table, name, }: {
|
|
99
102
|
database: string;
|
|
100
103
|
table: string;
|
|
101
|
-
|
|
104
|
+
name: string;
|
|
102
105
|
}): string;
|
|
103
|
-
abstract
|
|
106
|
+
abstract addIndex({ table, name, columns, }: {
|
|
107
|
+
table: string;
|
|
108
|
+
name: string;
|
|
109
|
+
columns: string[];
|
|
110
|
+
}): string;
|
|
111
|
+
abstract dropIndex({ table, name }: {
|
|
112
|
+
table: string;
|
|
113
|
+
name: string;
|
|
114
|
+
}): string;
|
|
115
|
+
abstract hasUnique({ database, table, name, }: {
|
|
116
|
+
database: string;
|
|
117
|
+
table: string;
|
|
118
|
+
name: string;
|
|
119
|
+
}): string;
|
|
120
|
+
abstract addUnique({ table, name, columns, }: {
|
|
121
|
+
table: string;
|
|
122
|
+
name: string;
|
|
123
|
+
columns: string[];
|
|
124
|
+
}): string;
|
|
125
|
+
abstract dropUnique({ table, name }: {
|
|
126
|
+
table: string;
|
|
127
|
+
name: string;
|
|
128
|
+
}): string;
|
|
129
|
+
abstract hasPrimaryKey({ database, table, }: {
|
|
130
|
+
database: string;
|
|
131
|
+
table: string;
|
|
132
|
+
}): string;
|
|
133
|
+
abstract addPrimaryKey({ table, columns, }: {
|
|
134
|
+
table: string;
|
|
135
|
+
columns: string[];
|
|
136
|
+
}): string;
|
|
137
|
+
abstract dropPrimaryKey({ table }: {
|
|
104
138
|
table: string;
|
|
105
|
-
index: string;
|
|
106
|
-
key: string;
|
|
107
139
|
}): string;
|
|
108
140
|
abstract getDatabase(database: string): string;
|
|
109
141
|
abstract dropDatabase(database: string): string;
|
|
@@ -112,6 +144,8 @@ export declare abstract class QueryBuilder {
|
|
|
112
144
|
abstract truncate(table: string): string;
|
|
113
145
|
abstract sleep(second: number): string;
|
|
114
146
|
abstract format(sql: (string | null)[] | string): string;
|
|
147
|
+
abstract getActiveConnections(): string;
|
|
148
|
+
abstract getMaxConnections(): string;
|
|
115
149
|
protected abstract bindJoin(values: string[]): string | null;
|
|
116
150
|
protected abstract bindWhere(values: string[]): string | null;
|
|
117
151
|
protected abstract bindOrderBy(values: string[]): string | null;
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryBuilder = exports.BaseDriver = void 0;
|
|
4
4
|
const events_1 = require("events");
|
|
5
|
-
const
|
|
5
|
+
const Package_1 = require("../Package");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
class BaseDriver extends events_1.EventEmitter {
|
|
8
8
|
SLOW_QUERY_EXECUTE_TIME = 1000 * 15;
|
|
9
9
|
SLOW_QUERY_LIMIT_LENGTH = 1000 * 2;
|
|
10
10
|
pool;
|
|
11
|
+
poolTrx;
|
|
11
12
|
options;
|
|
13
|
+
MESSAGE_TRX_NOT_STARTED = "The transaction has not been started";
|
|
12
14
|
MESSAGE_TRX_CLOSED = "The transaction has either been closed";
|
|
13
15
|
import(mod) {
|
|
14
|
-
return
|
|
16
|
+
return Package_1.Package.import(mod);
|
|
15
17
|
}
|
|
16
18
|
_detectEventQuery({ start, sql }) {
|
|
17
19
|
const duration = Date.now() - start;
|
|
@@ -39,10 +41,10 @@ class BaseDriver extends events_1.EventEmitter {
|
|
|
39
41
|
return message;
|
|
40
42
|
}
|
|
41
43
|
_detectQueryType(query) {
|
|
42
|
-
const selectRegex =
|
|
43
|
-
const updateRegex =
|
|
44
|
-
const insertRegex =
|
|
45
|
-
const deleteRegex =
|
|
44
|
+
const selectRegex = /^\s*SELECT\b/i;
|
|
45
|
+
const updateRegex = /^\s*UPDATE\b/i;
|
|
46
|
+
const insertRegex = /^\s*INSERT\b/i;
|
|
47
|
+
const deleteRegex = /^\s*DELETE\b/i;
|
|
46
48
|
if (selectRegex.test(query))
|
|
47
49
|
return "SELECT";
|
|
48
50
|
if (updateRegex.test(query))
|
|
@@ -51,7 +53,7 @@ class BaseDriver extends events_1.EventEmitter {
|
|
|
51
53
|
return "INSERT";
|
|
52
54
|
if (deleteRegex.test(query))
|
|
53
55
|
return "DELETE";
|
|
54
|
-
return "";
|
|
56
|
+
return "UNKNOWN";
|
|
55
57
|
}
|
|
56
58
|
_onPoolConnect(pool) {
|
|
57
59
|
const delay = 0;
|