tspace-mysql 1.3.0 → 1.3.2
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 +72 -14
- package/dist/cli/dump/db.d.ts +4 -4
- package/dist/cli/dump/db.js +25 -25
- package/dist/cli/generate/make.d.ts +4 -4
- package/dist/cli/generate/make.js +45 -45
- package/dist/cli/generate/model.d.ts +2 -2
- package/dist/cli/generate/model.js +6 -6
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +58 -58
- package/dist/cli/migrate/make.d.ts +4 -4
- package/dist/cli/migrate/make.js +30 -30
- package/dist/cli/models/make.d.ts +4 -4
- package/dist/cli/models/make.js +51 -51
- package/dist/cli/models/model.d.ts +2 -2
- package/dist/cli/models/model.js +20 -11
- package/dist/cli/query/index.d.ts +4 -4
- package/dist/cli/query/index.js +7 -7
- package/dist/cli/tables/make.d.ts +4 -4
- package/dist/cli/tables/make.js +26 -26
- package/dist/cli/tables/table.d.ts +2 -2
- package/dist/cli/tables/table.js +6 -6
- package/dist/lib/connection/index.d.ts +30 -30
- package/dist/lib/connection/index.js +144 -143
- package/dist/lib/connection/options.d.ts +15 -4
- package/dist/lib/connection/options.js +43 -42
- package/dist/lib/constants/index.d.ts +5 -8
- package/dist/lib/constants/index.js +162 -158
- package/dist/lib/index.d.ts +8 -8
- package/dist/lib/index.js +36 -36
- package/dist/lib/tspace/{AbstractDatabase.d.ts → AbstractBuilder.d.ts} +124 -116
- package/dist/lib/tspace/{AbstractDatabase.js → AbstractBuilder.js} +36 -34
- package/dist/lib/tspace/AbstractDB.d.ts +18 -18
- package/dist/lib/tspace/AbstractDB.js +11 -11
- package/dist/lib/tspace/AbstractModel.d.ts +43 -41
- package/dist/lib/tspace/AbstractModel.js +11 -11
- package/dist/lib/tspace/Blueprint.d.ts +136 -136
- package/dist/lib/tspace/Blueprint.js +228 -228
- package/dist/lib/tspace/{Database.d.ts → Builder.d.ts} +825 -706
- package/dist/lib/tspace/{Database.js → Builder.js} +2548 -2363
- package/dist/lib/tspace/DB.d.ts +152 -126
- package/dist/lib/tspace/DB.js +373 -264
- package/dist/lib/tspace/Interface.d.ts +110 -109
- package/dist/lib/tspace/Interface.js +2 -2
- package/dist/lib/tspace/Logger.d.ts +8 -8
- package/dist/lib/tspace/Logger.js +49 -49
- package/dist/lib/tspace/Model.d.ts +708 -609
- package/dist/lib/tspace/Model.js +2519 -2477
- package/dist/lib/tspace/ProxyHandler.d.ts +14 -14
- package/dist/lib/tspace/ProxyHandler.js +31 -31
- package/dist/lib/tspace/Schema.d.ts +8 -8
- package/dist/lib/tspace/Schema.js +45 -44
- package/dist/lib/tspace/index.d.ts +15 -15
- package/dist/lib/tspace/index.js +20 -20
- package/dist/lib/utils/index.d.ts +15 -15
- package/dist/lib/utils/index.js +155 -165
- package/package.json +2 -4
|
@@ -1,116 +1,124 @@
|
|
|
1
|
-
import { Pagination } from './Interface';
|
|
2
|
-
declare abstract class
|
|
3
|
-
protected $setters: string[];
|
|
4
|
-
protected $utils: {
|
|
5
|
-
[key: string]: Function;
|
|
6
|
-
};
|
|
7
|
-
protected $constants: Function;
|
|
8
|
-
protected $state: {
|
|
9
|
-
original: Function;
|
|
10
|
-
get: Function;
|
|
11
|
-
set: Function;
|
|
12
|
-
clone: Function;
|
|
13
|
-
};
|
|
14
|
-
protected $pool: {
|
|
15
|
-
query: Function;
|
|
16
|
-
set: Function;
|
|
17
|
-
get: Function;
|
|
18
|
-
};
|
|
19
|
-
protected $logger: {
|
|
20
|
-
get: Function;
|
|
21
|
-
set: (value: string) => void;
|
|
22
|
-
check: (value: string) => boolean;
|
|
23
|
-
};
|
|
24
|
-
protected $attributes: {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
} | null;
|
|
27
|
-
abstract void(): this;
|
|
28
|
-
abstract debug(): this;
|
|
29
|
-
abstract dd(): this;
|
|
30
|
-
abstract select(...columns: string[]): this;
|
|
31
|
-
abstract distinct(...columns: string[]): this;
|
|
32
|
-
abstract whereNull(column: string): this;
|
|
33
|
-
abstract whereNotNull(column: string): this;
|
|
34
|
-
abstract where(column: string, operator: string, value: string): this;
|
|
35
|
-
abstract whereSensitive(column: string, operator: string, value: string): this;
|
|
36
|
-
abstract whereRaw(sql: string): this;
|
|
37
|
-
abstract whereId(id: number): this;
|
|
38
|
-
abstract whereUser(id: number): this;
|
|
39
|
-
abstract whereEmail(value: string): this;
|
|
40
|
-
abstract whereQuery(callback: Function): this;
|
|
41
|
-
abstract orWhere(column: string, operator: string, value: string): this;
|
|
42
|
-
abstract whereIn(column: string, arrayValues: Array<any>): this;
|
|
43
|
-
abstract orWhereIn(column: string, arrayValues: Array<any>): this;
|
|
44
|
-
abstract whereNotIn(column: string, arrayValues: Array<any>): this;
|
|
45
|
-
abstract whereSubQuery(column: string, subQuery: string): this;
|
|
46
|
-
abstract whereNotSubQuery(column: string, subQuery: string): this;
|
|
47
|
-
abstract orWhereSubQuery(column: string, subQuery: string): this;
|
|
48
|
-
abstract whereBetween(column: string, arrayValue: Array<any>): this;
|
|
49
|
-
abstract having(condition: string): this;
|
|
50
|
-
abstract
|
|
51
|
-
abstract
|
|
52
|
-
abstract
|
|
53
|
-
abstract
|
|
54
|
-
abstract
|
|
55
|
-
abstract
|
|
56
|
-
abstract
|
|
57
|
-
abstract
|
|
58
|
-
abstract
|
|
59
|
-
abstract
|
|
60
|
-
abstract
|
|
61
|
-
abstract
|
|
62
|
-
abstract
|
|
63
|
-
abstract
|
|
64
|
-
abstract
|
|
65
|
-
abstract
|
|
66
|
-
abstract
|
|
67
|
-
abstract
|
|
68
|
-
abstract
|
|
69
|
-
abstract
|
|
70
|
-
abstract
|
|
71
|
-
abstract
|
|
72
|
-
abstract
|
|
73
|
-
abstract
|
|
74
|
-
abstract
|
|
75
|
-
abstract
|
|
76
|
-
abstract
|
|
77
|
-
abstract
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
abstract
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}): Promise<
|
|
92
|
-
abstract
|
|
93
|
-
abstract
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
abstract
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
abstract
|
|
100
|
-
abstract
|
|
101
|
-
abstract
|
|
102
|
-
abstract
|
|
103
|
-
abstract
|
|
104
|
-
abstract
|
|
105
|
-
abstract
|
|
106
|
-
abstract
|
|
107
|
-
abstract
|
|
108
|
-
abstract
|
|
109
|
-
abstract
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
abstract
|
|
113
|
-
abstract
|
|
114
|
-
abstract
|
|
115
|
-
|
|
116
|
-
|
|
1
|
+
import { Pagination } from './Interface';
|
|
2
|
+
declare abstract class AbstractBuilder {
|
|
3
|
+
protected $setters: string[];
|
|
4
|
+
protected $utils: {
|
|
5
|
+
[key: string]: Function;
|
|
6
|
+
};
|
|
7
|
+
protected $constants: Function;
|
|
8
|
+
protected $state: {
|
|
9
|
+
original: Function;
|
|
10
|
+
get: Function;
|
|
11
|
+
set: Function;
|
|
12
|
+
clone: Function;
|
|
13
|
+
};
|
|
14
|
+
protected $pool: {
|
|
15
|
+
query: Function;
|
|
16
|
+
set: Function;
|
|
17
|
+
get: Function;
|
|
18
|
+
};
|
|
19
|
+
protected $logger: {
|
|
20
|
+
get: Function;
|
|
21
|
+
set: (value: string) => void;
|
|
22
|
+
check: (value: string) => boolean;
|
|
23
|
+
};
|
|
24
|
+
protected $attributes: {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
} | null;
|
|
27
|
+
abstract void(): this;
|
|
28
|
+
abstract debug(): this;
|
|
29
|
+
abstract dd(): this;
|
|
30
|
+
abstract select(...columns: string[]): this;
|
|
31
|
+
abstract distinct(...columns: string[]): this;
|
|
32
|
+
abstract whereNull(column: string): this;
|
|
33
|
+
abstract whereNotNull(column: string): this;
|
|
34
|
+
abstract where(column: string, operator: string, value: string): this;
|
|
35
|
+
abstract whereSensitive(column: string, operator: string, value: string): this;
|
|
36
|
+
abstract whereRaw(sql: string): this;
|
|
37
|
+
abstract whereId(id: number): this;
|
|
38
|
+
abstract whereUser(id: number): this;
|
|
39
|
+
abstract whereEmail(value: string): this;
|
|
40
|
+
abstract whereQuery(callback: Function): this;
|
|
41
|
+
abstract orWhere(column: string, operator: string, value: string): this;
|
|
42
|
+
abstract whereIn(column: string, arrayValues: Array<any>): this;
|
|
43
|
+
abstract orWhereIn(column: string, arrayValues: Array<any>): this;
|
|
44
|
+
abstract whereNotIn(column: string, arrayValues: Array<any>): this;
|
|
45
|
+
abstract whereSubQuery(column: string, subQuery: string): this;
|
|
46
|
+
abstract whereNotSubQuery(column: string, subQuery: string): this;
|
|
47
|
+
abstract orWhereSubQuery(column: string, subQuery: string): this;
|
|
48
|
+
abstract whereBetween(column: string, arrayValue: Array<any>): this;
|
|
49
|
+
abstract having(condition: string): this;
|
|
50
|
+
abstract havingRaw(condition: string): this;
|
|
51
|
+
abstract join(pk: string, fk: string): this;
|
|
52
|
+
abstract rightJoin(pk: string, fk: string): this;
|
|
53
|
+
abstract leftJoin(pk: string, fk: string): this;
|
|
54
|
+
abstract crossJoin(pk: string, fk: string): this;
|
|
55
|
+
abstract orderBy(column: string, order: string): this;
|
|
56
|
+
abstract orderByRaw(column: string, order: string): this;
|
|
57
|
+
abstract latest(...columns: Array<string>): this;
|
|
58
|
+
abstract latestRaw(...columns: Array<string>): this;
|
|
59
|
+
abstract oldest(...columns: Array<string>): this;
|
|
60
|
+
abstract oldestRaw(...columns: Array<string>): this;
|
|
61
|
+
abstract groupBy(...columns: string[]): this;
|
|
62
|
+
abstract groupByRaw(...columns: string[]): this;
|
|
63
|
+
abstract random(): this;
|
|
64
|
+
abstract inRandom(): this;
|
|
65
|
+
abstract limit(number: number): this;
|
|
66
|
+
abstract hidden(...columns: string[]): this;
|
|
67
|
+
abstract insert(objects: object): this;
|
|
68
|
+
abstract create(objects: object): this;
|
|
69
|
+
abstract update(objects: object): this;
|
|
70
|
+
abstract insertNotExists(objects: object): this;
|
|
71
|
+
abstract createNotExists(objects: object): this;
|
|
72
|
+
abstract insertOrUpdate(objects: object): this;
|
|
73
|
+
abstract createOrUpdate(objects: object): this;
|
|
74
|
+
abstract updateOrInsert(objects: object): this;
|
|
75
|
+
abstract updateOrCreate(objects: object): this;
|
|
76
|
+
abstract createMultiple(objects: object): this;
|
|
77
|
+
abstract insertMultiple(objects: object): this;
|
|
78
|
+
abstract except(...columns: string[]): this;
|
|
79
|
+
abstract only(...columns: string[]): this;
|
|
80
|
+
abstract drop(): Promise<any>;
|
|
81
|
+
abstract truncate(): Promise<any>;
|
|
82
|
+
abstract all(): Promise<Array<any>>;
|
|
83
|
+
abstract find(id: number): Promise<any>;
|
|
84
|
+
abstract pagination({ limit, page }: {
|
|
85
|
+
limit: number;
|
|
86
|
+
page: number;
|
|
87
|
+
}): Promise<Pagination>;
|
|
88
|
+
abstract paginate({ limit, page }: {
|
|
89
|
+
limit: number;
|
|
90
|
+
page: number;
|
|
91
|
+
}): Promise<Pagination>;
|
|
92
|
+
abstract first(): Promise<any>;
|
|
93
|
+
abstract firstOrError(message: string, options?: {
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}): Promise<any>;
|
|
96
|
+
abstract findOneOrError(message: string, options?: {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
}): Promise<any>;
|
|
99
|
+
abstract get(): Promise<any>;
|
|
100
|
+
abstract findOne(): Promise<any>;
|
|
101
|
+
abstract findMany(): Promise<any>;
|
|
102
|
+
abstract getGroupBy(column: string): Promise<any>;
|
|
103
|
+
abstract findManyGroupBy(column: string): Promise<any>;
|
|
104
|
+
abstract toArray(column: string): Promise<any>;
|
|
105
|
+
abstract toJSON(): Promise<any>;
|
|
106
|
+
abstract toSQL(): string;
|
|
107
|
+
abstract toString(): string;
|
|
108
|
+
abstract count(column: string): Promise<number>;
|
|
109
|
+
abstract sum(column: string): Promise<number>;
|
|
110
|
+
abstract avg(column: string): Promise<number>;
|
|
111
|
+
abstract max(column: string): Promise<number>;
|
|
112
|
+
abstract min(column: string): Promise<number>;
|
|
113
|
+
abstract rawQuery(sql: string): Promise<Array<any>>;
|
|
114
|
+
abstract delete(): Promise<boolean>;
|
|
115
|
+
abstract exists(): Promise<boolean>;
|
|
116
|
+
abstract save(): Promise<{
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
} | Array<any> | null | undefined>;
|
|
119
|
+
abstract increment(column: string, value: number): Promise<any>;
|
|
120
|
+
abstract decrement(column: string, value: number): Promise<any>;
|
|
121
|
+
abstract faker(round: number): Promise<any>;
|
|
122
|
+
}
|
|
123
|
+
export { AbstractBuilder };
|
|
124
|
+
export default AbstractBuilder;
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'$
|
|
8
|
-
'$
|
|
9
|
-
'$
|
|
10
|
-
'$
|
|
11
|
-
'$
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.$
|
|
15
|
-
this.$
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractBuilder = void 0;
|
|
4
|
+
class AbstractBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.$setters = [
|
|
7
|
+
'$attributes',
|
|
8
|
+
'$logger',
|
|
9
|
+
'$utils',
|
|
10
|
+
'$constants',
|
|
11
|
+
'$pool',
|
|
12
|
+
'$state',
|
|
13
|
+
];
|
|
14
|
+
this.$utils = {};
|
|
15
|
+
this.$constants = (name) => { };
|
|
16
|
+
this.$state = {
|
|
17
|
+
original: () => { },
|
|
18
|
+
get: (key) => { },
|
|
19
|
+
set: (key, value) => { },
|
|
20
|
+
clone: (data) => { }
|
|
21
|
+
};
|
|
22
|
+
this.$pool = {
|
|
23
|
+
query: (sql) => { },
|
|
24
|
+
set: (pool) => { },
|
|
25
|
+
get: () => { }
|
|
26
|
+
};
|
|
27
|
+
this.$logger = {
|
|
28
|
+
get: () => { },
|
|
29
|
+
set: (value) => { },
|
|
30
|
+
check: (value) => true || false
|
|
31
|
+
};
|
|
32
|
+
this.$attributes = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.AbstractBuilder = AbstractBuilder;
|
|
36
|
+
exports.default = AbstractBuilder;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, ConnectionOptions } from './Interface';
|
|
3
|
-
declare abstract class AbstractDB extends
|
|
4
|
-
abstract table(tableName: string): void;
|
|
5
|
-
abstract beginTransaction(): Promise<any>;
|
|
6
|
-
abstract generateUUID(): string;
|
|
7
|
-
abstract raw(sql: string): string;
|
|
8
|
-
abstract constants(constants?: string): string | {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
abstract caseUpdate(cases: {
|
|
12
|
-
when: string;
|
|
13
|
-
then: string;
|
|
14
|
-
}[], final?: string): string | [];
|
|
15
|
-
abstract getConnection(options: ConnectionOptions): Connection;
|
|
16
|
-
}
|
|
17
|
-
export { AbstractDB };
|
|
18
|
-
export default AbstractDB;
|
|
1
|
+
import Builder from './Builder';
|
|
2
|
+
import { Connection, ConnectionOptions } from './Interface';
|
|
3
|
+
declare abstract class AbstractDB extends Builder {
|
|
4
|
+
abstract table(tableName: string): void;
|
|
5
|
+
abstract beginTransaction(): Promise<any>;
|
|
6
|
+
abstract generateUUID(): string;
|
|
7
|
+
abstract raw(sql: string): string;
|
|
8
|
+
abstract constants(constants?: string): string | {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
abstract caseUpdate(cases: {
|
|
12
|
+
when: string;
|
|
13
|
+
then: string;
|
|
14
|
+
}[], final?: string): string | [];
|
|
15
|
+
abstract getConnection(options: ConnectionOptions): Connection;
|
|
16
|
+
}
|
|
17
|
+
export { AbstractDB };
|
|
18
|
+
export default AbstractDB;
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
exports.AbstractDB = void 0;
|
|
7
|
-
const
|
|
8
|
-
class AbstractDB extends
|
|
9
|
-
}
|
|
10
|
-
exports.AbstractDB = AbstractDB;
|
|
11
|
-
exports.default = AbstractDB;
|
|
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
|
+
exports.AbstractDB = void 0;
|
|
7
|
+
const Builder_1 = __importDefault(require("./Builder"));
|
|
8
|
+
class AbstractDB extends Builder_1.default {
|
|
9
|
+
}
|
|
10
|
+
exports.AbstractDB = AbstractDB;
|
|
11
|
+
exports.default = AbstractDB;
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import { Relation, RelationQuery } from './Interface';
|
|
2
|
-
import
|
|
3
|
-
declare abstract class AbstractModel extends
|
|
4
|
-
protected abstract useUUID(): this;
|
|
5
|
-
protected abstract usePrimaryKey(primaryKey: string): this;
|
|
6
|
-
protected abstract useRegistry(): this;
|
|
7
|
-
protected abstract useDebug(): this;
|
|
8
|
-
protected abstract useTable(table: string): this;
|
|
9
|
-
protected abstract useTablePlural(): this;
|
|
10
|
-
protected abstract useTableSingular(): this;
|
|
11
|
-
protected abstract useTimestamp(): this;
|
|
12
|
-
protected abstract useSoftDelete(): this;
|
|
13
|
-
protected abstract usePattern(pattern: string): this;
|
|
14
|
-
protected abstract define(): void;
|
|
15
|
-
protected abstract hasOne({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
16
|
-
protected abstract hasMany({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
17
|
-
protected abstract belongsTo({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
18
|
-
protected abstract belongsToMany({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
19
|
-
protected abstract buildMethodRelation(name: string, callback?: Function): this;
|
|
20
|
-
protected abstract hasOneBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
21
|
-
protected abstract hasManyBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
22
|
-
protected abstract belongsToBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
23
|
-
protected abstract belongsToManyBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
24
|
-
abstract ignoreSoftDelete(): this;
|
|
25
|
-
abstract disableSoftDelete(): this;
|
|
26
|
-
abstract registry(func: {
|
|
27
|
-
[key: string]: Function;
|
|
28
|
-
}): this;
|
|
29
|
-
abstract onlyTrashed(): Promise<any>;
|
|
30
|
-
abstract trashed(): Promise<any>;
|
|
31
|
-
abstract restore(): Promise<any>;
|
|
32
|
-
abstract with(...nameRelations: string[]): this;
|
|
33
|
-
abstract withQuery(nameRelations: string, callback: Function): this;
|
|
34
|
-
abstract withExists(...nameRelations: string[]): this;
|
|
35
|
-
abstract
|
|
36
|
-
abstract
|
|
37
|
-
abstract
|
|
38
|
-
abstract
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { Relation, RelationQuery } from './Interface';
|
|
2
|
+
import Builder from './Builder';
|
|
3
|
+
declare abstract class AbstractModel extends Builder {
|
|
4
|
+
protected abstract useUUID(): this;
|
|
5
|
+
protected abstract usePrimaryKey(primaryKey: string): this;
|
|
6
|
+
protected abstract useRegistry(): this;
|
|
7
|
+
protected abstract useDebug(): this;
|
|
8
|
+
protected abstract useTable(table: string): this;
|
|
9
|
+
protected abstract useTablePlural(): this;
|
|
10
|
+
protected abstract useTableSingular(): this;
|
|
11
|
+
protected abstract useTimestamp(): this;
|
|
12
|
+
protected abstract useSoftDelete(): this;
|
|
13
|
+
protected abstract usePattern(pattern: string): this;
|
|
14
|
+
protected abstract define(): void;
|
|
15
|
+
protected abstract hasOne({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
16
|
+
protected abstract hasMany({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
17
|
+
protected abstract belongsTo({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
18
|
+
protected abstract belongsToMany({ name, model, localKey, foreignKey, freezeTable, as }: Relation): this;
|
|
19
|
+
protected abstract buildMethodRelation(name: string, callback?: Function): this;
|
|
20
|
+
protected abstract hasOneBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
21
|
+
protected abstract hasManyBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
22
|
+
protected abstract belongsToBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
23
|
+
protected abstract belongsToManyBuilder({ name, model, localKey, foreignKey, freezeTable, as }: RelationQuery, callback: Function): this;
|
|
24
|
+
abstract ignoreSoftDelete(): this;
|
|
25
|
+
abstract disableSoftDelete(): this;
|
|
26
|
+
abstract registry(func: {
|
|
27
|
+
[key: string]: Function;
|
|
28
|
+
}): this;
|
|
29
|
+
abstract onlyTrashed(): Promise<any>;
|
|
30
|
+
abstract trashed(): Promise<any>;
|
|
31
|
+
abstract restore(): Promise<any>;
|
|
32
|
+
abstract with(...nameRelations: string[]): this;
|
|
33
|
+
abstract withQuery(nameRelations: string, callback: Function): this;
|
|
34
|
+
abstract withExists(...nameRelations: string[]): this;
|
|
35
|
+
abstract withAndTrashed(...nameRelations: string[]): this;
|
|
36
|
+
abstract has(...nameRelations: string[]): this;
|
|
37
|
+
abstract relations(...nameRelations: string[]): this;
|
|
38
|
+
abstract relationQuery(nameRelations: string, callback: Function): this;
|
|
39
|
+
abstract relationsExists(...nameRelations: string[]): this;
|
|
40
|
+
abstract relationsAndTrashed(...nameRelations: string[]): this;
|
|
41
|
+
}
|
|
42
|
+
export { AbstractModel };
|
|
43
|
+
export default AbstractModel;
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
exports.AbstractModel = void 0;
|
|
7
|
-
const
|
|
8
|
-
class AbstractModel extends
|
|
9
|
-
}
|
|
10
|
-
exports.AbstractModel = AbstractModel;
|
|
11
|
-
exports.default = AbstractModel;
|
|
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
|
+
exports.AbstractModel = void 0;
|
|
7
|
+
const Builder_1 = __importDefault(require("./Builder"));
|
|
8
|
+
class AbstractModel extends Builder_1.default {
|
|
9
|
+
}
|
|
10
|
+
exports.AbstractModel = AbstractModel;
|
|
11
|
+
exports.default = AbstractModel;
|