tspace-mysql 1.2.9 → 1.3.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.
Files changed (56) hide show
  1. package/README.md +64 -14
  2. package/dist/cli/dump/db.d.ts +4 -4
  3. package/dist/cli/dump/db.js +25 -25
  4. package/dist/cli/generate/make.d.ts +4 -4
  5. package/dist/cli/generate/make.js +45 -45
  6. package/dist/cli/generate/model.d.ts +2 -2
  7. package/dist/cli/generate/model.js +6 -6
  8. package/dist/cli/index.d.ts +2 -2
  9. package/dist/cli/index.js +58 -58
  10. package/dist/cli/migrate/make.d.ts +4 -4
  11. package/dist/cli/migrate/make.js +30 -30
  12. package/dist/cli/models/make.d.ts +4 -4
  13. package/dist/cli/models/make.js +51 -51
  14. package/dist/cli/models/model.d.ts +2 -2
  15. package/dist/cli/models/model.js +20 -11
  16. package/dist/cli/query/index.d.ts +4 -4
  17. package/dist/cli/query/index.js +7 -7
  18. package/dist/cli/tables/make.d.ts +4 -4
  19. package/dist/cli/tables/make.js +26 -26
  20. package/dist/cli/tables/table.d.ts +2 -2
  21. package/dist/cli/tables/table.js +6 -6
  22. package/dist/lib/connection/index.d.ts +30 -30
  23. package/dist/lib/connection/index.js +144 -143
  24. package/dist/lib/connection/options.d.ts +15 -4
  25. package/dist/lib/connection/options.js +43 -42
  26. package/dist/lib/constants/index.d.ts +5 -8
  27. package/dist/lib/constants/index.js +162 -158
  28. package/dist/lib/index.d.ts +8 -8
  29. package/dist/lib/index.js +36 -36
  30. package/dist/lib/tspace/{AbstractDatabase.d.ts → AbstractBuilder.d.ts} +124 -116
  31. package/dist/lib/tspace/{AbstractDatabase.js → AbstractBuilder.js} +36 -34
  32. package/dist/lib/tspace/AbstractDB.d.ts +18 -18
  33. package/dist/lib/tspace/AbstractDB.js +11 -11
  34. package/dist/lib/tspace/AbstractModel.d.ts +41 -41
  35. package/dist/lib/tspace/AbstractModel.js +11 -11
  36. package/dist/lib/tspace/Blueprint.d.ts +136 -136
  37. package/dist/lib/tspace/Blueprint.js +228 -228
  38. package/dist/lib/tspace/{Database.d.ts → Builder.d.ts} +833 -706
  39. package/dist/lib/tspace/{Database.js → Builder.js} +2556 -2363
  40. package/dist/lib/tspace/DB.d.ts +152 -126
  41. package/dist/lib/tspace/DB.js +373 -264
  42. package/dist/lib/tspace/Interface.d.ts +110 -109
  43. package/dist/lib/tspace/Interface.js +2 -2
  44. package/dist/lib/tspace/Logger.d.ts +8 -8
  45. package/dist/lib/tspace/Logger.js +49 -49
  46. package/dist/lib/tspace/Model.d.ts +708 -609
  47. package/dist/lib/tspace/Model.js +2520 -2477
  48. package/dist/lib/tspace/ProxyHandler.d.ts +14 -14
  49. package/dist/lib/tspace/ProxyHandler.js +31 -31
  50. package/dist/lib/tspace/Schema.d.ts +8 -8
  51. package/dist/lib/tspace/Schema.js +45 -44
  52. package/dist/lib/tspace/index.d.ts +15 -15
  53. package/dist/lib/tspace/index.js +20 -20
  54. package/dist/lib/utils/index.d.ts +15 -15
  55. package/dist/lib/utils/index.js +155 -165
  56. package/package.json +2 -4
@@ -1,158 +1,162 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONSTANTS = void 0;
4
- const CONSTANTS = {
5
- ID: 'ID',
6
- SHOW: 'SHOW',
7
- SHOW_TABLES: 'SHOW TABLES',
8
- FIELDS: 'FIELDS',
9
- COLUMNS: 'COLUMNS',
10
- WHERE: 'WHERE',
11
- BETWEEN: 'BETWEEN',
12
- AND: 'AND',
13
- IS_NULL: 'IS NULL',
14
- IS_NOT_NULL: 'IS NOT NULL',
15
- OR: 'OR',
16
- LIKE: 'LIKE',
17
- SELECT: 'SELECT',
18
- SELECTED: '*',
19
- DISTINCT: 'DISTINCT',
20
- FROM: 'FROM',
21
- OFFSET: 'OFFSET',
22
- GROUP_BY: 'GROUP BY',
23
- GROUP_CONCAT: 'GROUP_CONCAT',
24
- ORDER_BY: 'ORDER BY',
25
- DESC: 'DESC',
26
- ASC: 'ASC',
27
- INNER_JOIN: 'INNER JOIN',
28
- LEFT_JOIN: 'LEFT JOIN',
29
- RIGHT_JOIN: 'RIGHT JOIN',
30
- CROSS_JOIN: 'CROSS JOIN',
31
- ON: 'ON',
32
- LIMIT: 'LIMIT',
33
- HAVING: 'HAVING',
34
- COUNT: 'COUNT',
35
- AVG: 'AVG',
36
- SUM: 'SUM',
37
- MAX: 'MAX',
38
- MIN: 'MIN',
39
- AS: 'AS',
40
- IN: 'IN',
41
- ALL: 'ALL',
42
- ANY: 'ANY',
43
- NOT_IN: 'NOT IN',
44
- SET: 'SET',
45
- NOT: 'NOT',
46
- DUPLICATE: 'DUPLICATE',
47
- KEY: 'KEY',
48
- RAW: '$RAW',
49
- WHEN: 'WHEN',
50
- THEN: 'THEN',
51
- ELSE: 'ELSE',
52
- CASE: 'CASE',
53
- END: 'END',
54
- WHERE_NOT_EXISTS: 'WHERE NOT EXISTS',
55
- EXISTS: 'EXISTS',
56
- VALUES: 'VALUES',
57
- UPDATE: 'UPDATE',
58
- DELETE: 'DELETE',
59
- INSERT: 'INSERT INTO',
60
- DROP_TABLE: 'DROP TABLE',
61
- TRUNCATE_TABLE: 'TRUNCATE TABLE',
62
- CREATE_DATABASE: 'CREATE DATABASE',
63
- CREATE_DATABASE_NOT_EXISTS: 'CREATE DATABASE IF NOT EXISTS',
64
- CREATE_TABLE: 'CREATE TABLE',
65
- CREATE_TABLE_NOT_EXISTS: 'CREATE TABLE IF NOT EXISTS',
66
- ENGINE: 'ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8',
67
- RELATIONSHIP: {
68
- hasOne: 'hasOne',
69
- hasMany: 'hasMany',
70
- belongsTo: 'belongsTo',
71
- belongsToMany: 'belongsToMany'
72
- },
73
- PATTERN: {
74
- snake_case: 'snake_case',
75
- camelCase: 'camelCase'
76
- },
77
- DB: {
78
- PRIMARY_KEY: 'id',
79
- VOID: false,
80
- RESULT: null,
81
- DISTINCT: '',
82
- PLUCK: '',
83
- SAVE: '',
84
- DELETE: '',
85
- UPDATE: '',
86
- INSERT: '',
87
- SELECT: '',
88
- ONLY: [],
89
- EXCEPT: [],
90
- CHUNK: 0,
91
- COUNT: '',
92
- FROM: '',
93
- JOIN: '',
94
- WHERE: '',
95
- GROUP_BY: '',
96
- ORDER_BY: '',
97
- LIMIT: '',
98
- OFFSET: '',
99
- HAVING: '',
100
- TABLE_NAME: '',
101
- UUID_CUSTOM: '',
102
- HIDDEN: [],
103
- DEBUG: false,
104
- UUID: false,
105
- PAGE: 1,
106
- PER_PAGE: 1,
107
- HOOK: []
108
- },
109
- MODEL: {
110
- PRIMARY_KEY: 'id',
111
- VOID: false,
112
- SELECT: '',
113
- DELETE: '',
114
- UPDATE: '',
115
- INSERT: '',
116
- ONLY: [],
117
- EXCEPT: [],
118
- CHUNK: 0,
119
- COUNT: '',
120
- FROM: '',
121
- JOIN: '',
122
- WHERE: '',
123
- GROUP_BY: '',
124
- ORDER_BY: '',
125
- LIMIT: '',
126
- OFFSET: '',
127
- HAVING: '',
128
- TABLE_NAME: '',
129
- UUID_FORMAT: 'uuid',
130
- HIDDEN: [],
131
- DEBUG: false,
132
- UUID: false,
133
- SOFT_DELETE: false,
134
- SOFT_DELETE_FORMAT: 'deleted_at',
135
- SOFT_DELETE_RELATIONS: false,
136
- RELATION: [],
137
- PAGE: 1,
138
- PER_PAGE: 1,
139
- REGISTRY: {},
140
- RESULT: null,
141
- PATTERN: 'snake_case',
142
- DISTINCT: '',
143
- PLUCK: '',
144
- SAVE: '',
145
- HOOK: [],
146
- WITH: [],
147
- WITH_EXISTS: false,
148
- WITH_EXISTS_NOT_ID: [],
149
- TIMESTAMP: false,
150
- TIMESTAMP_FORMAT: {
151
- CREATED_AT: 'created_at',
152
- UPDATED_AT: 'updated_at'
153
- },
154
- SCHEMA: null
155
- }
156
- };
157
- exports.CONSTANTS = CONSTANTS;
158
- exports.default = Object.freeze(CONSTANTS);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONSTANTS = void 0;
4
+ const CONSTANTS = Object.freeze({
5
+ ID: 'ID',
6
+ SHOW: 'SHOW',
7
+ SHOW_TABLES: 'SHOW TABLES',
8
+ FIELDS: 'FIELDS',
9
+ COLUMNS: 'COLUMNS',
10
+ WHERE: 'WHERE',
11
+ BETWEEN: 'BETWEEN',
12
+ AND: 'AND',
13
+ IS_NULL: 'IS NULL',
14
+ IS_NOT_NULL: 'IS NOT NULL',
15
+ OR: 'OR',
16
+ LIKE: 'LIKE',
17
+ SELECT: 'SELECT',
18
+ SELECTED: '*',
19
+ DISTINCT: 'DISTINCT',
20
+ FROM: 'FROM',
21
+ OFFSET: 'OFFSET',
22
+ GROUP_BY: 'GROUP BY',
23
+ GROUP_CONCAT: 'GROUP_CONCAT',
24
+ ORDER_BY: 'ORDER BY',
25
+ DESC: 'DESC',
26
+ ASC: 'ASC',
27
+ INNER_JOIN: 'INNER JOIN',
28
+ LEFT_JOIN: 'LEFT JOIN',
29
+ RIGHT_JOIN: 'RIGHT JOIN',
30
+ CROSS_JOIN: 'CROSS JOIN',
31
+ ON: 'ON',
32
+ LIMIT: 'LIMIT',
33
+ HAVING: 'HAVING',
34
+ COUNT: 'COUNT',
35
+ AVG: 'AVG',
36
+ SUM: 'SUM',
37
+ MAX: 'MAX',
38
+ MIN: 'MIN',
39
+ AS: 'AS',
40
+ IN: 'IN',
41
+ ALL: 'ALL',
42
+ ANY: 'ANY',
43
+ NOT_IN: 'NOT IN',
44
+ SET: 'SET',
45
+ NOT: 'NOT',
46
+ DUPLICATE: 'DUPLICATE',
47
+ KEY: 'KEY',
48
+ RAW: '$RAW',
49
+ WHEN: 'WHEN',
50
+ THEN: 'THEN',
51
+ ELSE: 'ELSE',
52
+ CASE: 'CASE',
53
+ END: 'END',
54
+ WHERE_NOT_EXISTS: 'WHERE NOT EXISTS',
55
+ EXISTS: 'EXISTS',
56
+ VALUES: 'VALUES',
57
+ UPDATE: 'UPDATE',
58
+ DELETE: 'DELETE',
59
+ INSERT: 'INSERT INTO',
60
+ DROP_TABLE: 'DROP TABLE',
61
+ TRUNCATE_TABLE: 'TRUNCATE TABLE',
62
+ CREATE_DATABASE: 'CREATE DATABASE',
63
+ CREATE_DATABASE_NOT_EXISTS: 'CREATE DATABASE IF NOT EXISTS',
64
+ CREATE_TABLE: 'CREATE TABLE',
65
+ CREATE_TABLE_NOT_EXISTS: 'CREATE TABLE IF NOT EXISTS',
66
+ ENGINE: 'ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8',
67
+ RAND: 'RAND()',
68
+ RELATIONSHIP: {
69
+ hasOne: 'hasOne',
70
+ hasMany: 'hasMany',
71
+ belongsTo: 'belongsTo',
72
+ belongsToMany: 'belongsToMany'
73
+ },
74
+ PATTERN: {
75
+ snake_case: 'snake_case',
76
+ camelCase: 'camelCase'
77
+ },
78
+ DB: {
79
+ PRIMARY_KEY: 'id',
80
+ VOID: false,
81
+ RESULT: null,
82
+ DISTINCT: '',
83
+ PLUCK: '',
84
+ SAVE: '',
85
+ DELETE: '',
86
+ UPDATE: '',
87
+ INSERT: '',
88
+ SELECT: '',
89
+ ONLY: [],
90
+ EXCEPT: [],
91
+ CHUNK: 0,
92
+ COUNT: '',
93
+ FROM: '',
94
+ JOIN: '',
95
+ WHERE: '',
96
+ TEST: [],
97
+ GROUP_BY: '',
98
+ ORDER_BY: '',
99
+ LIMIT: '',
100
+ OFFSET: '',
101
+ HAVING: '',
102
+ TABLE_NAME: '',
103
+ UUID_CUSTOM: '',
104
+ HIDDEN: [],
105
+ DEBUG: false,
106
+ UUID: false,
107
+ PAGE: 1,
108
+ PER_PAGE: 1,
109
+ HOOK: []
110
+ },
111
+ MODEL: {
112
+ PRIMARY_KEY: 'id',
113
+ VOID: false,
114
+ SELECT: '',
115
+ DELETE: '',
116
+ UPDATE: '',
117
+ INSERT: '',
118
+ ONLY: [],
119
+ EXCEPT: [],
120
+ CHUNK: 0,
121
+ COUNT: '',
122
+ FROM: '',
123
+ JOIN: '',
124
+ WHERE: '',
125
+ GROUP_BY: '',
126
+ ORDER_BY: '',
127
+ LIMIT: '',
128
+ OFFSET: '',
129
+ HAVING: '',
130
+ TABLE_NAME: '',
131
+ UUID_FORMAT: 'uuid',
132
+ HIDDEN: [],
133
+ DEBUG: false,
134
+ UUID: false,
135
+ SOFT_DELETE: false,
136
+ SOFT_DELETE_FORMAT: 'deleted_at',
137
+ SOFT_DELETE_RELATIONS: false,
138
+ RELATION: [],
139
+ PAGE: 1,
140
+ PER_PAGE: 1,
141
+ REGISTRY: {},
142
+ RESULT: null,
143
+ PATTERN: 'snake_case',
144
+ DISTINCT: '',
145
+ PLUCK: '',
146
+ SAVE: '',
147
+ HOOK: [],
148
+ RELATIONS: [],
149
+ RELATIONS_TRASHED: false,
150
+ RELATIONS_EXISTS: false,
151
+ RELATIONS_EXISTS_NOT_ID: [],
152
+ TIMESTAMP: false,
153
+ TIMESTAMP_FORMAT: {
154
+ CREATED_AT: 'created_at',
155
+ UPDATED_AT: 'updated_at'
156
+ },
157
+ SCHEMA: null,
158
+ FUNCTION_RELATION: false
159
+ }
160
+ });
161
+ exports.CONSTANTS = CONSTANTS;
162
+ exports.default = CONSTANTS;
@@ -1,8 +1,8 @@
1
- /**
2
- * The entry point.
3
- *
4
- * @module tspace-mysql
5
- */
6
- import * as tspace from './tspace';
7
- export * from './tspace';
8
- export default tspace;
1
+ /**
2
+ * The entry point.
3
+ *
4
+ * @module tspace-mysql
5
+ */
6
+ import * as tspace from './tspace';
7
+ export * from './tspace';
8
+ export default tspace;
package/dist/lib/index.js CHANGED
@@ -1,36 +1,36 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- /**
30
- * The entry point.
31
- *
32
- * @module tspace-mysql
33
- */
34
- const tspace = __importStar(require("./tspace"));
35
- __exportStar(require("./tspace"), exports);
36
- exports.default = tspace;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ /**
30
+ * The entry point.
31
+ *
32
+ * @module tspace-mysql
33
+ */
34
+ const tspace = __importStar(require("./tspace"));
35
+ __exportStar(require("./tspace"), exports);
36
+ exports.default = tspace;
@@ -1,116 +1,124 @@
1
- import { Pagination } from './Interface';
2
- declare abstract class AbstractDatabase {
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 join(pk: string, fk: string): this;
51
- abstract rightJoin(pk: string, fk: string): this;
52
- abstract leftJoin(pk: string, fk: string): this;
53
- abstract crossJoin(pk: string, fk: string): this;
54
- abstract orderBy(column: string, order: string): this;
55
- abstract latest(...columns: Array<string>): this;
56
- abstract oldest(...columns: Array<string>): this;
57
- abstract groupBy(...columns: string[]): this;
58
- abstract limit(number: number): this;
59
- abstract hidden(...columns: string[]): this;
60
- abstract insert(objects: object): this;
61
- abstract create(objects: object): this;
62
- abstract update(objects: object): this;
63
- abstract insertNotExists(objects: object): this;
64
- abstract createNotExists(objects: object): this;
65
- abstract insertOrUpdate(objects: object): this;
66
- abstract createOrUpdate(objects: object): this;
67
- abstract updateOrInsert(objects: object): this;
68
- abstract updateOrCreate(objects: object): this;
69
- abstract createMultiple(objects: object): this;
70
- abstract insertMultiple(objects: object): this;
71
- abstract except(...columns: string[]): this;
72
- abstract only(...columns: string[]): this;
73
- abstract drop(): Promise<any>;
74
- abstract truncate(): Promise<any>;
75
- abstract all(): Promise<Array<any>>;
76
- abstract find(id: number): Promise<any>;
77
- abstract pagination({ limit, page }: {
78
- limit: number;
79
- page: number;
80
- }): Promise<Pagination>;
81
- abstract paginate({ limit, page }: {
82
- limit: number;
83
- page: number;
84
- }): Promise<Pagination>;
85
- abstract first(): Promise<any>;
86
- abstract firstOrError(message: string, options?: {
87
- [key: string]: any;
88
- }): Promise<any>;
89
- abstract findOneOrError(message: string, options?: {
90
- [key: string]: any;
91
- }): Promise<any>;
92
- abstract get(): Promise<any>;
93
- abstract findOne(): Promise<any>;
94
- abstract findMany(): Promise<any>;
95
- abstract getGroupBy(column: string): Promise<any>;
96
- abstract findManyGroupBy(column: string): Promise<any>;
97
- abstract toArray(column: string): Promise<any>;
98
- abstract toJSON(): Promise<any>;
99
- abstract toSQL(): string;
100
- abstract toString(): string;
101
- abstract count(column: string): Promise<number>;
102
- abstract sum(column: string): Promise<number>;
103
- abstract avg(column: string): Promise<number>;
104
- abstract max(column: string): Promise<number>;
105
- abstract min(column: string): Promise<number>;
106
- abstract rawQuery(sql: string): Promise<Array<any>>;
107
- abstract delete(): Promise<boolean>;
108
- abstract exists(): Promise<boolean>;
109
- abstract save(): Promise<{
110
- [key: string]: any;
111
- } | Array<any> | null | undefined>;
112
- abstract increment(column: string, value: number): Promise<any>;
113
- abstract decrement(column: string, value: number): Promise<any>;
114
- abstract faker(round: number): Promise<any>;
115
- }
116
- export default AbstractDatabase;
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;