myorm_pg 2.5.2 → 2.6.0

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.
Files changed (60) hide show
  1. package/lib/Index.d.ts +32 -32
  2. package/lib/Index.js +53 -53
  3. package/lib/core/decorators/SchemasDecorators.d.ts +44 -44
  4. package/lib/core/decorators/SchemasDecorators.js +144 -144
  5. package/lib/core/decorators/SchemasDecorators.js.map +1 -1
  6. package/lib/core/design/Type.d.ts +38 -37
  7. package/lib/core/design/Type.d.ts.map +1 -1
  8. package/lib/core/design/Type.js +142 -137
  9. package/lib/core/design/Type.js.map +1 -1
  10. package/lib/core/enums/DBTypes.d.ts +18 -18
  11. package/lib/core/enums/DBTypes.js +22 -22
  12. package/lib/core/enums/DBTypes.js.map +1 -1
  13. package/lib/core/enums/RelationType.d.ts +6 -6
  14. package/lib/core/enums/RelationType.js +10 -10
  15. package/lib/core/enums/RelationType.js.map +1 -1
  16. package/lib/core/exceptions/ConnectionFailException.d.ts +4 -4
  17. package/lib/core/exceptions/ConnectionFailException.js +12 -12
  18. package/lib/core/exceptions/ConstraintFailException.d.ts +4 -4
  19. package/lib/core/exceptions/ConstraintFailException.js +12 -12
  20. package/lib/core/exceptions/Exception.d.ts +4 -4
  21. package/lib/core/exceptions/Exception.js +9 -9
  22. package/lib/core/exceptions/InvalidOperationException.d.ts +5 -5
  23. package/lib/core/exceptions/InvalidOperationException.js +13 -13
  24. package/lib/core/exceptions/NotImplementedException.d.ts +4 -4
  25. package/lib/core/exceptions/NotImplementedException.js +12 -12
  26. package/lib/core/exceptions/QueryFailException.d.ts +5 -5
  27. package/lib/core/exceptions/QueryFailException.js +13 -13
  28. package/lib/core/exceptions/TypeNotSuportedException.d.ts +4 -4
  29. package/lib/core/exceptions/TypeNotSuportedException.js +12 -12
  30. package/lib/core/objects/DBOperationLogHandler.d.ts +15 -15
  31. package/lib/core/objects/DBOperationLogHandler.js +16 -16
  32. package/lib/core/objects/DBOperationLogHandler.js.map +1 -1
  33. package/lib/core/objects/interfaces/IDBConnection.d.ts +13 -13
  34. package/lib/core/objects/interfaces/IDBConnection.js +2 -2
  35. package/lib/core/objects/interfaces/IDBContext.d.ts +41 -41
  36. package/lib/core/objects/interfaces/IDBContext.js +2 -2
  37. package/lib/core/objects/interfaces/IDBManager.d.ts +12 -12
  38. package/lib/core/objects/interfaces/IDBManager.js +2 -2
  39. package/lib/core/objects/interfaces/IDBSet.d.ts +38 -35
  40. package/lib/core/objects/interfaces/IDBSet.d.ts.map +1 -1
  41. package/lib/core/objects/interfaces/IDBSet.js +2 -2
  42. package/lib/core/objects/interfaces/IStatement.d.ts +16 -16
  43. package/lib/core/objects/interfaces/IStatement.js +15 -15
  44. package/lib/core/objects/interfaces/IStatement.js.map +1 -1
  45. package/lib/implementations/PGDBConnection.d.ts +18 -18
  46. package/lib/implementations/PGDBConnection.js +102 -102
  47. package/lib/implementations/PGDBContext.d.ts +55 -55
  48. package/lib/implementations/PGDBContext.js +298 -298
  49. package/lib/implementations/PGDBManager.d.ts +31 -31
  50. package/lib/implementations/PGDBManager.js +242 -242
  51. package/lib/implementations/PGDBSet.d.ts +52 -48
  52. package/lib/implementations/PGDBSet.d.ts.map +1 -1
  53. package/lib/implementations/PGDBSet.js +984 -928
  54. package/lib/implementations/PGDBSet.js.map +1 -1
  55. package/lib/implementations/PGFluentField.d.ts +17 -17
  56. package/lib/implementations/PGFluentField.js +153 -153
  57. package/lib/implementations/PGSetHelper.d.ts +18 -18
  58. package/lib/implementations/PGSetHelper.js +47 -47
  59. package/lib/implementations/PGSetHelper.js.map +1 -1
  60. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import Exception from "./Exception";
2
- export default class InvalidOperationException extends Exception {
3
- Message: string;
4
- constructor(message: string);
5
- }
1
+ import Exception from "./Exception";
2
+ export default class InvalidOperationException extends Exception {
3
+ Message: string;
4
+ constructor(message: string);
5
+ }
6
6
  //# sourceMappingURL=InvalidOperationException.d.ts.map
@@ -1,14 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Exception_1 = __importDefault(require("./Exception"));
7
- class InvalidOperationException extends Exception_1.default {
8
- constructor(message) {
9
- super(message);
10
- this.Message = message;
11
- }
12
- }
13
- exports.default = InvalidOperationException;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class InvalidOperationException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ this.Message = message;
11
+ }
12
+ }
13
+ exports.default = InvalidOperationException;
14
14
  //# sourceMappingURL=InvalidOperationException.js.map
@@ -1,5 +1,5 @@
1
- import Exception from "./Exception";
2
- export default class NotImpletedException extends Exception {
3
- constructor(message: string);
4
- }
1
+ import Exception from "./Exception";
2
+ export default class NotImpletedException extends Exception {
3
+ constructor(message: string);
4
+ }
5
5
  //# sourceMappingURL=NotImplementedException.d.ts.map
@@ -1,13 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Exception_1 = __importDefault(require("./Exception"));
7
- class NotImpletedException extends Exception_1.default {
8
- constructor(message) {
9
- super(message);
10
- }
11
- }
12
- exports.default = NotImpletedException;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class NotImpletedException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ }
11
+ }
12
+ exports.default = NotImpletedException;
13
13
  //# sourceMappingURL=NotImplementedException.js.map
@@ -1,6 +1,6 @@
1
- import Exception from "./Exception";
2
- export default class QueryFailException extends Exception {
3
- Query: string;
4
- constructor(message: string, query: string);
5
- }
1
+ import Exception from "./Exception";
2
+ export default class QueryFailException extends Exception {
3
+ Query: string;
4
+ constructor(message: string, query: string);
5
+ }
6
6
  //# sourceMappingURL=QueryFailException.d.ts.map
@@ -1,14 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Exception_1 = __importDefault(require("./Exception"));
7
- class QueryFailException extends Exception_1.default {
8
- constructor(message, query) {
9
- super(message);
10
- this.Query = query;
11
- }
12
- }
13
- exports.default = QueryFailException;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class QueryFailException extends Exception_1.default {
8
+ constructor(message, query) {
9
+ super(message);
10
+ this.Query = query;
11
+ }
12
+ }
13
+ exports.default = QueryFailException;
14
14
  //# sourceMappingURL=QueryFailException.js.map
@@ -1,5 +1,5 @@
1
- import Exception from "./Exception";
2
- export default class TypeNotSuportedException extends Exception {
3
- constructor(message: string);
4
- }
1
+ import Exception from "./Exception";
2
+ export default class TypeNotSuportedException extends Exception {
3
+ constructor(message: string);
4
+ }
5
5
  //# sourceMappingURL=TypeNotSuportedException.d.ts.map
@@ -1,13 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Exception_1 = __importDefault(require("./Exception"));
7
- class TypeNotSuportedException extends Exception_1.default {
8
- constructor(message) {
9
- super(message);
10
- }
11
- }
12
- exports.default = TypeNotSuportedException;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class TypeNotSuportedException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ }
11
+ }
12
+ exports.default = TypeNotSuportedException;
13
13
  //# sourceMappingURL=TypeNotSuportedException.js.map
@@ -1,16 +1,16 @@
1
- export default interface DBOperationLogHandler {
2
- (message: string, type: LogType): void;
3
- }
4
- export declare enum LogType {
5
- CHECKCONNECTION = 0,
6
- CHECKDATABASE = 1,
7
- CREATEDATABASE = 2,
8
- CHECKTABLE = 3,
9
- CREATETABLE = 4,
10
- CHECKCOLUMN = 5,
11
- CREATECOLUMN = 6,
12
- CHANGECOLUMN = 7,
13
- CHECKENTITY = 8,
14
- QUERY = 9
15
- }
1
+ export default interface DBOperationLogHandler {
2
+ (message: string, type: LogType): void;
3
+ }
4
+ export declare enum LogType {
5
+ CHECKCONNECTION = 0,
6
+ CHECKDATABASE = 1,
7
+ CREATEDATABASE = 2,
8
+ CHECKTABLE = 3,
9
+ CREATETABLE = 4,
10
+ CHECKCOLUMN = 5,
11
+ CREATECOLUMN = 6,
12
+ CHANGECOLUMN = 7,
13
+ CHECKENTITY = 8,
14
+ QUERY = 9
15
+ }
16
16
  //# sourceMappingURL=DBOperationLogHandler.d.ts.map
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogType = void 0;
4
- var LogType;
5
- (function (LogType) {
6
- LogType[LogType["CHECKCONNECTION"] = 0] = "CHECKCONNECTION";
7
- LogType[LogType["CHECKDATABASE"] = 1] = "CHECKDATABASE";
8
- LogType[LogType["CREATEDATABASE"] = 2] = "CREATEDATABASE";
9
- LogType[LogType["CHECKTABLE"] = 3] = "CHECKTABLE";
10
- LogType[LogType["CREATETABLE"] = 4] = "CREATETABLE";
11
- LogType[LogType["CHECKCOLUMN"] = 5] = "CHECKCOLUMN";
12
- LogType[LogType["CREATECOLUMN"] = 6] = "CREATECOLUMN";
13
- LogType[LogType["CHANGECOLUMN"] = 7] = "CHANGECOLUMN";
14
- LogType[LogType["CHECKENTITY"] = 8] = "CHECKENTITY";
15
- LogType[LogType["QUERY"] = 9] = "QUERY";
16
- })(LogType = exports.LogType || (exports.LogType = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogType = void 0;
4
+ var LogType;
5
+ (function (LogType) {
6
+ LogType[LogType["CHECKCONNECTION"] = 0] = "CHECKCONNECTION";
7
+ LogType[LogType["CHECKDATABASE"] = 1] = "CHECKDATABASE";
8
+ LogType[LogType["CREATEDATABASE"] = 2] = "CREATEDATABASE";
9
+ LogType[LogType["CHECKTABLE"] = 3] = "CHECKTABLE";
10
+ LogType[LogType["CREATETABLE"] = 4] = "CREATETABLE";
11
+ LogType[LogType["CHECKCOLUMN"] = 5] = "CHECKCOLUMN";
12
+ LogType[LogType["CREATECOLUMN"] = 6] = "CREATECOLUMN";
13
+ LogType[LogType["CHANGECOLUMN"] = 7] = "CHANGECOLUMN";
14
+ LogType[LogType["CHECKENTITY"] = 8] = "CHECKENTITY";
15
+ LogType[LogType["QUERY"] = 9] = "QUERY";
16
+ })(LogType || (exports.LogType = LogType = {}));
17
17
  //# sourceMappingURL=DBOperationLogHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DBOperationLogHandler.js","sourceRoot":"","sources":["../../../src/core/objects/DBOperationLogHandler.ts"],"names":[],"mappings":";;;AAKA,IAAY,OAYX;AAZD,WAAY,OAAO;IAEf,2DAAe,CAAA;IACf,uDAAa,CAAA;IACb,yDAAc,CAAA;IACd,iDAAU,CAAA;IACV,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,qDAAY,CAAA;IACZ,qDAAY,CAAA;IACZ,mDAAW,CAAA;IACX,uCAAK,CAAA;AACT,CAAC,EAZW,OAAO,GAAP,eAAO,KAAP,eAAO,QAYlB"}
1
+ {"version":3,"file":"DBOperationLogHandler.js","sourceRoot":"","sources":["../../../src/core/objects/DBOperationLogHandler.ts"],"names":[],"mappings":";;;AAKA,IAAY,OAYX;AAZD,WAAY,OAAO;IAEf,2DAAe,CAAA;IACf,uDAAa,CAAA;IACb,yDAAc,CAAA;IACd,iDAAU,CAAA;IACV,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,qDAAY,CAAA;IACZ,qDAAY,CAAA;IACZ,mDAAW,CAAA;IACX,uCAAK,CAAA;AACT,CAAC,EAZW,OAAO,uBAAP,OAAO,QAYlB"}
@@ -1,14 +1,14 @@
1
- export default interface IDBConnection {
2
- HostName: string;
3
- Port: number;
4
- DataBaseName: string;
5
- UserName: string;
6
- PassWord: string;
7
- IsOpen: boolean;
8
- Open(): Promise<void>;
9
- Query(query: string): Promise<any>;
10
- Close(): void;
11
- ExecuteNonQuery(query: string): Promise<void>;
12
- Execute(query: string): Promise<any>;
13
- }
1
+ export default interface IDBConnection {
2
+ HostName: string;
3
+ Port: number;
4
+ DataBaseName: string;
5
+ UserName: string;
6
+ PassWord: string;
7
+ IsOpen: boolean;
8
+ Open(): Promise<void>;
9
+ Query(query: string): Promise<any>;
10
+ Close(): void;
11
+ ExecuteNonQuery(query: string): Promise<void>;
12
+ Execute(query: string): Promise<any>;
13
+ }
14
14
  //# sourceMappingURL=IDBConnection.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDBConnection.js.map
@@ -1,42 +1,42 @@
1
- import IDBSet from './IDBSet';
2
- import IStatement from './IStatement';
3
- export default interface IDBContext {
4
- Collection<T extends Object>(cTor: {
5
- new (...args: any[]): T;
6
- }): IDBSet<T> | undefined;
7
- UpdateDatabaseAsync(): Promise<void>;
8
- ExecuteNonQuery(query: string): Promise<void>;
9
- ExecuteQuery(query: string): Promise<any>;
10
- }
11
- export interface IThreeQueryableObject {
12
- Join(...args: {
13
- new (...args: any[]): Object;
14
- }[]): IJoiningQuery;
15
- }
16
- export interface IJoiningQuery {
17
- On<C extends Object, U extends Object>(cT: {
18
- new (...args: any[]): C;
19
- }, cKey: keyof C, uT: {
20
- new (...args: any[]): U;
21
- }, uKey: keyof U): IJoiningQuery;
22
- Where<C extends Object, K extends keyof C>(cT: {
23
- new (...args: any[]): C;
24
- }, statement: IStatement<C, K>): IJoiningQuery;
25
- And<C extends Object, K extends keyof C>(cT: {
26
- new (...args: any[]): C;
27
- }, statement: IStatement<C, K>): IJoiningQuery;
28
- Or<C extends Object, K extends keyof C>(cT: {
29
- new (...args: any[]): C;
30
- }, statement: IStatement<C, K>): IJoiningQuery;
31
- Select<C extends Object>(cT: {
32
- new (...args: any[]): C;
33
- }): IJoinSelectable<C>;
34
- }
35
- export interface IJoinSelectable<T> {
36
- ToListAsync(): Promise<T[]>;
37
- FirstOrDefaultAsync(): Promise<T | undefined>;
38
- Join<K extends keyof T>(key: K): IJoinSelectable<T>;
39
- OrderBy<K extends keyof T>(key: K): IJoinSelectable<T>;
40
- OrderDescendingBy<K extends keyof T>(key: K): IJoinSelectable<T>;
41
- }
1
+ import IDBSet from './IDBSet';
2
+ import IStatement from './IStatement';
3
+ export default interface IDBContext {
4
+ Collection<T extends Object>(cTor: {
5
+ new (...args: any[]): T;
6
+ }): IDBSet<T> | undefined;
7
+ UpdateDatabaseAsync(): Promise<void>;
8
+ ExecuteNonQuery(query: string): Promise<void>;
9
+ ExecuteQuery(query: string): Promise<any>;
10
+ }
11
+ export interface IThreeQueryableObject {
12
+ Join(...args: {
13
+ new (...args: any[]): Object;
14
+ }[]): IJoiningQuery;
15
+ }
16
+ export interface IJoiningQuery {
17
+ On<C extends Object, U extends Object>(cT: {
18
+ new (...args: any[]): C;
19
+ }, cKey: keyof C, uT: {
20
+ new (...args: any[]): U;
21
+ }, uKey: keyof U): IJoiningQuery;
22
+ Where<C extends Object, K extends keyof C>(cT: {
23
+ new (...args: any[]): C;
24
+ }, statement: IStatement<C, K>): IJoiningQuery;
25
+ And<C extends Object, K extends keyof C>(cT: {
26
+ new (...args: any[]): C;
27
+ }, statement: IStatement<C, K>): IJoiningQuery;
28
+ Or<C extends Object, K extends keyof C>(cT: {
29
+ new (...args: any[]): C;
30
+ }, statement: IStatement<C, K>): IJoiningQuery;
31
+ Select<C extends Object>(cT: {
32
+ new (...args: any[]): C;
33
+ }): IJoinSelectable<C>;
34
+ }
35
+ export interface IJoinSelectable<T> {
36
+ ToListAsync(): Promise<T[]>;
37
+ FirstOrDefaultAsync(): Promise<T | undefined>;
38
+ Join<K extends keyof T>(key: K): IJoinSelectable<T>;
39
+ OrderBy<K extends keyof T>(key: K): IJoinSelectable<T>;
40
+ OrderDescendingBy<K extends keyof T>(key: K): IJoinSelectable<T>;
41
+ }
42
42
  //# sourceMappingURL=IDBContext.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDBContext.js.map
@@ -1,13 +1,13 @@
1
- export default interface IDBManager {
2
- CheckConnection(): Promise<boolean>;
3
- CheckDatabase(dababase: string): Promise<boolean>;
4
- CreateDataBase(dababase: string): Promise<void>;
5
- CheckTable(cTor: Function): Promise<boolean>;
6
- CreateTable(cTor: Function): Promise<void>;
7
- CheckColumn(cTor: Function, key: string): Promise<boolean>;
8
- CreateColumn(cTor: Function, key: string): Promise<void>;
9
- UpdateDatabaseForEntity(cTor: Function): Promise<void>;
10
- ExecuteNonQuery(query: string): Promise<void>;
11
- Execute(query: string): Promise<any>;
12
- }
1
+ export default interface IDBManager {
2
+ CheckConnection(): Promise<boolean>;
3
+ CheckDatabase(dababase: string): Promise<boolean>;
4
+ CreateDataBase(dababase: string): Promise<void>;
5
+ CheckTable(cTor: Function): Promise<boolean>;
6
+ CreateTable(cTor: Function): Promise<void>;
7
+ CheckColumn(cTor: Function, key: string): Promise<boolean>;
8
+ CreateColumn(cTor: Function, key: string): Promise<void>;
9
+ UpdateDatabaseForEntity(cTor: Function): Promise<void>;
10
+ ExecuteNonQuery(query: string): Promise<void>;
11
+ Execute(query: string): Promise<any>;
12
+ }
13
13
  //# sourceMappingURL=IDBManager.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDBManager.js.map
@@ -1,36 +1,39 @@
1
- import IStatement from "./IStatement";
2
- export default interface IDBSet<T extends Object> {
3
- AddAsync(obj: T): Promise<T>;
4
- UpdateAsync(obj: T): Promise<T>;
5
- DeleteAsync(obj: T): Promise<T>;
6
- Where<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
7
- And<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
8
- Or<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
9
- OrderBy<K extends keyof T>(key: K): IDBSet<T>;
10
- OrderDescendingBy<K extends keyof T>(key: K): IDBSet<T>;
11
- Join<K extends keyof T>(key: K): IDBSet<T>;
12
- Limit(limit: number): IDBSet<T>;
13
- CountAsync(): Promise<number>;
14
- ToListAsync(): Promise<T[]>;
15
- FirstOrDefaultAsync(): Promise<T | undefined>;
16
- CleanQueryTree(): void;
17
- }
18
- export interface IFluentQueryableObject<T extends Object, R extends IDBSet<T>> {
19
- WhereField<K extends keyof T>(field: K): IFluentField<T, K, R>;
20
- WhereAsString(where: string): R;
21
- AndField<K extends keyof T>(field: K): IFluentField<T, K, R>;
22
- OrField<K extends keyof T>(field: K): IFluentField<T, K, R>;
23
- LoadRelationOn<K extends keyof T>(field: K): R;
24
- }
25
- export interface IFluentField<T extends Object, K extends keyof T, R extends IDBSet<T>> {
26
- IsGreaterThan(value: T[K]): R;
27
- IsEqualTo(value: T[K]): R;
28
- IsNotEqualTo(value: T[K]): R;
29
- IsSmallerThan(value: T[K]): R;
30
- IsInsideIn(value: T[K][]): R;
31
- Constains(value: T[K]): R;
32
- StartsWith(value: T[K]): R;
33
- EndsWith(value: T[K]): R;
34
- IsNull(): R;
35
- }
1
+ import IStatement from "./IStatement";
2
+ export default interface IDBSet<T extends Object> {
3
+ AddAsync(obj: T): Promise<T>;
4
+ UpdateAsync(obj: T): Promise<T>;
5
+ UpdateObjectAndRelationsAsync(obj: T, relations: (keyof T)[]): Promise<T>;
6
+ DeleteAsync(obj: T): Promise<T>;
7
+ Where<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
8
+ And<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
9
+ Or<K extends keyof T>(statement: IStatement<T, K>): IDBSet<T>;
10
+ OrderBy<K extends keyof T>(key: K): IDBSet<T>;
11
+ OrderDescendingBy<K extends keyof T>(key: K): IDBSet<T>;
12
+ Take(quantity: number): IDBSet<T>;
13
+ Offset(offset: number): IDBSet<T>;
14
+ Join<K extends keyof T>(key: K): IDBSet<T>;
15
+ Limit(limit: number): IDBSet<T>;
16
+ CountAsync(): Promise<number>;
17
+ ToListAsync(): Promise<T[]>;
18
+ FirstOrDefaultAsync(): Promise<T | undefined>;
19
+ CleanQueryTree(): void;
20
+ }
21
+ export interface IFluentQueryableObject<T extends Object, R extends IDBSet<T>> {
22
+ WhereField<K extends keyof T>(field: K): IFluentField<T, K, R>;
23
+ WhereAsString(where: string): R;
24
+ AndField<K extends keyof T>(field: K): IFluentField<T, K, R>;
25
+ OrField<K extends keyof T>(field: K): IFluentField<T, K, R>;
26
+ LoadRelationOn<K extends keyof T>(field: K): R;
27
+ }
28
+ export interface IFluentField<T extends Object, K extends keyof T, R extends IDBSet<T>> {
29
+ IsGreaterThan(value: T[K]): R;
30
+ IsEqualTo(value: T[K]): R;
31
+ IsNotEqualTo(value: T[K]): R;
32
+ IsSmallerThan(value: T[K]): R;
33
+ IsInsideIn(value: T[K][]): R;
34
+ Constains(value: T[K]): R;
35
+ StartsWith(value: T[K]): R;
36
+ EndsWith(value: T[K]): R;
37
+ IsNull(): R;
38
+ }
36
39
  //# sourceMappingURL=IDBSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IDBSet.d.ts","sourceRoot":"","sources":["../../../../src/core/objects/interfaces/IDBSet.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC,CAAC,SAAS,MAAM;IAE5C,QAAQ,CAAC,GAAG,EAAG,CAAC,GAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,WAAW,CAAC,GAAG,EAAG,CAAC,GAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAClC,WAAW,CAAC,GAAG,EAAG,CAAC,GAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,SAAS,EAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IACnE,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,SAAS,EAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,SAAS,EAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAG,CAAC,GAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAG,CAAC,GAAI,MAAM,CAAC,CAAC,CAAC,CAAC;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C,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAG,CAAC,GAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9D,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAG,CAAC,GAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7D,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAG,CAAC,GAAI,CAAC,CAAC;CACpD;AAGD,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC;IAElF,aAAa,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAC5B,YAAY,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAC/B,aAAa,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAChC,UAAU,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAI,CAAC,CAAC;IAC/B,SAAS,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAC5B,UAAU,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC,CAAC,GAAI,CAAC,CAAC;IAC3B,MAAM,IAAK,CAAC,CAAC;CAChB"}
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDBSet.js.map
@@ -1,17 +1,17 @@
1
- export default interface IStatement<T, K extends keyof T> {
2
- Field: K;
3
- Kind?: Operation;
4
- Value: T[K];
5
- }
6
- export declare enum Operation {
7
- EQUALS = "==",
8
- NOTEQUALS = "!=",
9
- STARTWITH = "%_",
10
- ENDWITH = "_%",
11
- CONSTAINS = "%_%",
12
- GREATHER = ">",
13
- GREATHEROREQUALS = ">=",
14
- SMALLER = "<",
15
- SMALLEROREQUALS = "<="
16
- }
1
+ export default interface IStatement<T, K extends keyof T> {
2
+ Field: K;
3
+ Kind?: Operation;
4
+ Value: T[K];
5
+ }
6
+ export declare enum Operation {
7
+ EQUALS = "==",
8
+ NOTEQUALS = "!=",
9
+ STARTWITH = "%_",
10
+ ENDWITH = "_%",
11
+ CONSTAINS = "%_%",
12
+ GREATHER = ">",
13
+ GREATHEROREQUALS = ">=",
14
+ SMALLER = "<",
15
+ SMALLEROREQUALS = "<="
16
+ }
17
17
  //# sourceMappingURL=IStatement.d.ts.map
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Operation = void 0;
4
- var Operation;
5
- (function (Operation) {
6
- Operation["EQUALS"] = "==";
7
- Operation["NOTEQUALS"] = "!=";
8
- Operation["STARTWITH"] = "%_";
9
- Operation["ENDWITH"] = "_%";
10
- Operation["CONSTAINS"] = "%_%";
11
- Operation["GREATHER"] = ">";
12
- Operation["GREATHEROREQUALS"] = ">=";
13
- Operation["SMALLER"] = "<";
14
- Operation["SMALLEROREQUALS"] = "<=";
15
- })(Operation = exports.Operation || (exports.Operation = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Operation = void 0;
4
+ var Operation;
5
+ (function (Operation) {
6
+ Operation["EQUALS"] = "==";
7
+ Operation["NOTEQUALS"] = "!=";
8
+ Operation["STARTWITH"] = "%_";
9
+ Operation["ENDWITH"] = "_%";
10
+ Operation["CONSTAINS"] = "%_%";
11
+ Operation["GREATHER"] = ">";
12
+ Operation["GREATHEROREQUALS"] = ">=";
13
+ Operation["SMALLER"] = "<";
14
+ Operation["SMALLEROREQUALS"] = "<=";
15
+ })(Operation || (exports.Operation = Operation = {}));
16
16
  //# sourceMappingURL=IStatement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IStatement.js","sourceRoot":"","sources":["../../../../src/core/objects/interfaces/IStatement.ts"],"names":[],"mappings":";;;AAUA,IAAY,SAWX;AAXD,WAAY,SAAS;IAEjB,0BAAa,CAAA;IACb,6BAAgB,CAAA;IAChB,6BAAgB,CAAA;IAChB,2BAAc,CAAA;IACd,8BAAiB,CAAA;IACjB,2BAAc,CAAA;IACd,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,mCAAsB,CAAA;AAC1B,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB"}
1
+ {"version":3,"file":"IStatement.js","sourceRoot":"","sources":["../../../../src/core/objects/interfaces/IStatement.ts"],"names":[],"mappings":";;;AAUA,IAAY,SAWX;AAXD,WAAY,SAAS;IAEjB,0BAAa,CAAA;IACb,6BAAgB,CAAA;IAChB,6BAAgB,CAAA;IAChB,2BAAc,CAAA;IACd,8BAAiB,CAAA;IACjB,2BAAc,CAAA;IACd,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,mCAAsB,CAAA;AAC1B,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB"}
@@ -1,19 +1,19 @@
1
- import IDBConnection from "../core/objects/interfaces/IDBConnection";
2
- export default class PGDBConnection implements IDBConnection {
3
- HostName: string;
4
- Port: number;
5
- DataBaseName: string;
6
- UserName: string;
7
- PassWord: string;
8
- IsOpen: boolean;
9
- private _conn;
10
- private _database;
11
- constructor(host: string, port: number, dababase: string, user: string, pass: string);
12
- AsPostgres(): PGDBConnection;
13
- Open(): Promise<void>;
14
- Query(query: string): Promise<any>;
15
- Close(): Promise<void>;
16
- ExecuteNonQuery(query: string): Promise<void>;
17
- Execute(query: string): Promise<any>;
18
- }
1
+ import IDBConnection from "../core/objects/interfaces/IDBConnection";
2
+ export default class PGDBConnection implements IDBConnection {
3
+ HostName: string;
4
+ Port: number;
5
+ DataBaseName: string;
6
+ UserName: string;
7
+ PassWord: string;
8
+ IsOpen: boolean;
9
+ private _conn;
10
+ private _database;
11
+ constructor(host: string, port: number, dababase: string, user: string, pass: string);
12
+ AsPostgres(): PGDBConnection;
13
+ Open(): Promise<void>;
14
+ Query(query: string): Promise<any>;
15
+ Close(): Promise<void>;
16
+ ExecuteNonQuery(query: string): Promise<void>;
17
+ Execute(query: string): Promise<any>;
18
+ }
19
19
  //# sourceMappingURL=PGDBConnection.d.ts.map