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.
- package/README.md +64 -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 +41 -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} +833 -706
- package/dist/lib/tspace/{Database.js → Builder.js} +2556 -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 +2520 -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,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,41 @@
|
|
|
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 has(...nameRelations: string[]): this;
|
|
36
|
-
abstract relations(...nameRelations: string[]): this;
|
|
37
|
-
abstract relationQuery(nameRelations: string, callback: Function): this;
|
|
38
|
-
abstract relationsExists(...nameRelations: string[]): this;
|
|
39
|
-
}
|
|
40
|
-
export { AbstractModel };
|
|
41
|
-
export default AbstractModel;
|
|
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 has(...nameRelations: string[]): this;
|
|
36
|
+
abstract relations(...nameRelations: string[]): this;
|
|
37
|
+
abstract relationQuery(nameRelations: string, callback: Function): this;
|
|
38
|
+
abstract relationsExists(...nameRelations: string[]): this;
|
|
39
|
+
}
|
|
40
|
+
export { AbstractModel };
|
|
41
|
+
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;
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
declare class Blueprint {
|
|
2
|
-
protected type: string;
|
|
3
|
-
protected attrbuites: Array<string>;
|
|
4
|
-
/**
|
|
5
|
-
* Assign type 'int' in table
|
|
6
|
-
* @return {this} this
|
|
7
|
-
*/
|
|
8
|
-
int(): this;
|
|
9
|
-
/**
|
|
10
|
-
* Assign type 'TINYINT' in table
|
|
11
|
-
* @param {number} number
|
|
12
|
-
* @return {this} this
|
|
13
|
-
*/
|
|
14
|
-
tinyInt(number?: number): this;
|
|
15
|
-
/**
|
|
16
|
-
* Assign type 'BIGINT' in table
|
|
17
|
-
* @param {number} number [number = 10]
|
|
18
|
-
* @return {this} this
|
|
19
|
-
*/
|
|
20
|
-
bigInt(number?: number): this;
|
|
21
|
-
/**
|
|
22
|
-
* Assign type 'DOUBLE' in table
|
|
23
|
-
* @param {number} length between 1-255
|
|
24
|
-
* @param {number} decimal 0.000...n
|
|
25
|
-
* @return {this} this
|
|
26
|
-
*/
|
|
27
|
-
double(length?: number, decimal?: number): this;
|
|
28
|
-
/**
|
|
29
|
-
* Assign type 'FLOAT' in table
|
|
30
|
-
* @param {number} length between 1-255
|
|
31
|
-
* @param {number} decimal 0.000...n
|
|
32
|
-
* @return {this} this
|
|
33
|
-
*/
|
|
34
|
-
float(length?: number, decimal?: number): this;
|
|
35
|
-
/**
|
|
36
|
-
* Assign type 'VARCHAR' in table
|
|
37
|
-
* @param {number} length [length = 100] length of string
|
|
38
|
-
* @return {this} this
|
|
39
|
-
*/
|
|
40
|
-
varchar(length?: number): this;
|
|
41
|
-
/**
|
|
42
|
-
* Assign type 'CHAR' in table
|
|
43
|
-
* @param {number} length [length = 1] length of string
|
|
44
|
-
* @return {this} this
|
|
45
|
-
*/
|
|
46
|
-
char(length?: number): this;
|
|
47
|
-
/**
|
|
48
|
-
* Assign type 'LONGTEXT' in table
|
|
49
|
-
* @return {this} this
|
|
50
|
-
*/
|
|
51
|
-
longText(): this;
|
|
52
|
-
/**
|
|
53
|
-
* Assign type 'MEDIUMTEXT' in table
|
|
54
|
-
* @param {number} length [length = 1] length of string
|
|
55
|
-
* @return {this} this
|
|
56
|
-
*/
|
|
57
|
-
mediumText(): this;
|
|
58
|
-
/**
|
|
59
|
-
* Assign type 'TINYTEXT' in table
|
|
60
|
-
* @param {number} length [length = 1] length of string
|
|
61
|
-
* @return {this} this
|
|
62
|
-
*/
|
|
63
|
-
tinyText(): this;
|
|
64
|
-
/**
|
|
65
|
-
* Assign type 'TEXT' in table
|
|
66
|
-
* @param {number} length [length = 1] length of string
|
|
67
|
-
* @return {this} this
|
|
68
|
-
*/
|
|
69
|
-
text(): this;
|
|
70
|
-
/**
|
|
71
|
-
* Assign type 'ENUM'
|
|
72
|
-
* @param {...string} enums n1, n2, n3, ...n
|
|
73
|
-
* @return {this} this
|
|
74
|
-
*/
|
|
75
|
-
enum(...enums: Array<string>): this;
|
|
76
|
-
/**
|
|
77
|
-
* Assign type 'DATE' in table
|
|
78
|
-
* @return {this} this
|
|
79
|
-
*/
|
|
80
|
-
date(): this;
|
|
81
|
-
/**
|
|
82
|
-
* Assign type 'DATETIME' in table
|
|
83
|
-
* @return {this} this
|
|
84
|
-
*/
|
|
85
|
-
dateTime(): this;
|
|
86
|
-
/**
|
|
87
|
-
* Assign type 'TIMESTAMP' in table
|
|
88
|
-
* @return {this} this
|
|
89
|
-
*/
|
|
90
|
-
timestamp(): this;
|
|
91
|
-
/**
|
|
92
|
-
* Assign type 'UNSIGNED' in table
|
|
93
|
-
* @return {this} this
|
|
94
|
-
*/
|
|
95
|
-
unsigned(): this;
|
|
96
|
-
/**
|
|
97
|
-
* Assign type 'UNIQUE' in table
|
|
98
|
-
* @return {this} this
|
|
99
|
-
*/
|
|
100
|
-
unique(): this;
|
|
101
|
-
/**
|
|
102
|
-
* Assign type 'NULL' in table
|
|
103
|
-
* @return {this} this
|
|
104
|
-
*/
|
|
105
|
-
null(): this;
|
|
106
|
-
/**
|
|
107
|
-
* Assign type 'NOT NULL' in table
|
|
108
|
-
* @return {this} this
|
|
109
|
-
*/
|
|
110
|
-
notNull(): this;
|
|
111
|
-
/**
|
|
112
|
-
* Assign type 'PRIMARY KEY' in table
|
|
113
|
-
* @return {this} this
|
|
114
|
-
*/
|
|
115
|
-
primary(): this;
|
|
116
|
-
/**
|
|
117
|
-
* Assign attrbuites 'default' in table
|
|
118
|
-
* @param {string | number} n default value
|
|
119
|
-
* @return {this} this
|
|
120
|
-
*/
|
|
121
|
-
default(n: string | number): this;
|
|
122
|
-
/**
|
|
123
|
-
* Assign attrbuites 'default currentTimestamp' in table
|
|
124
|
-
* @return {this} this
|
|
125
|
-
*/
|
|
126
|
-
currentTimestamp(): this;
|
|
127
|
-
/**
|
|
128
|
-
* Assign attrbuites 'autoIncrement' in table
|
|
129
|
-
* @return {this} this
|
|
130
|
-
*/
|
|
131
|
-
autoIncrement(): this;
|
|
132
|
-
private _addAssignType;
|
|
133
|
-
private _addAssignAttrbuite;
|
|
134
|
-
}
|
|
135
|
-
export { Blueprint };
|
|
136
|
-
export default Blueprint;
|
|
1
|
+
declare class Blueprint {
|
|
2
|
+
protected type: string;
|
|
3
|
+
protected attrbuites: Array<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Assign type 'int' in table
|
|
6
|
+
* @return {this} this
|
|
7
|
+
*/
|
|
8
|
+
int(): this;
|
|
9
|
+
/**
|
|
10
|
+
* Assign type 'TINYINT' in table
|
|
11
|
+
* @param {number} number
|
|
12
|
+
* @return {this} this
|
|
13
|
+
*/
|
|
14
|
+
tinyInt(number?: number): this;
|
|
15
|
+
/**
|
|
16
|
+
* Assign type 'BIGINT' in table
|
|
17
|
+
* @param {number} number [number = 10]
|
|
18
|
+
* @return {this} this
|
|
19
|
+
*/
|
|
20
|
+
bigInt(number?: number): this;
|
|
21
|
+
/**
|
|
22
|
+
* Assign type 'DOUBLE' in table
|
|
23
|
+
* @param {number} length between 1-255
|
|
24
|
+
* @param {number} decimal 0.000...n
|
|
25
|
+
* @return {this} this
|
|
26
|
+
*/
|
|
27
|
+
double(length?: number, decimal?: number): this;
|
|
28
|
+
/**
|
|
29
|
+
* Assign type 'FLOAT' in table
|
|
30
|
+
* @param {number} length between 1-255
|
|
31
|
+
* @param {number} decimal 0.000...n
|
|
32
|
+
* @return {this} this
|
|
33
|
+
*/
|
|
34
|
+
float(length?: number, decimal?: number): this;
|
|
35
|
+
/**
|
|
36
|
+
* Assign type 'VARCHAR' in table
|
|
37
|
+
* @param {number} length [length = 100] length of string
|
|
38
|
+
* @return {this} this
|
|
39
|
+
*/
|
|
40
|
+
varchar(length?: number): this;
|
|
41
|
+
/**
|
|
42
|
+
* Assign type 'CHAR' in table
|
|
43
|
+
* @param {number} length [length = 1] length of string
|
|
44
|
+
* @return {this} this
|
|
45
|
+
*/
|
|
46
|
+
char(length?: number): this;
|
|
47
|
+
/**
|
|
48
|
+
* Assign type 'LONGTEXT' in table
|
|
49
|
+
* @return {this} this
|
|
50
|
+
*/
|
|
51
|
+
longText(): this;
|
|
52
|
+
/**
|
|
53
|
+
* Assign type 'MEDIUMTEXT' in table
|
|
54
|
+
* @param {number} length [length = 1] length of string
|
|
55
|
+
* @return {this} this
|
|
56
|
+
*/
|
|
57
|
+
mediumText(): this;
|
|
58
|
+
/**
|
|
59
|
+
* Assign type 'TINYTEXT' in table
|
|
60
|
+
* @param {number} length [length = 1] length of string
|
|
61
|
+
* @return {this} this
|
|
62
|
+
*/
|
|
63
|
+
tinyText(): this;
|
|
64
|
+
/**
|
|
65
|
+
* Assign type 'TEXT' in table
|
|
66
|
+
* @param {number} length [length = 1] length of string
|
|
67
|
+
* @return {this} this
|
|
68
|
+
*/
|
|
69
|
+
text(): this;
|
|
70
|
+
/**
|
|
71
|
+
* Assign type 'ENUM'
|
|
72
|
+
* @param {...string} enums n1, n2, n3, ...n
|
|
73
|
+
* @return {this} this
|
|
74
|
+
*/
|
|
75
|
+
enum(...enums: Array<string>): this;
|
|
76
|
+
/**
|
|
77
|
+
* Assign type 'DATE' in table
|
|
78
|
+
* @return {this} this
|
|
79
|
+
*/
|
|
80
|
+
date(): this;
|
|
81
|
+
/**
|
|
82
|
+
* Assign type 'DATETIME' in table
|
|
83
|
+
* @return {this} this
|
|
84
|
+
*/
|
|
85
|
+
dateTime(): this;
|
|
86
|
+
/**
|
|
87
|
+
* Assign type 'TIMESTAMP' in table
|
|
88
|
+
* @return {this} this
|
|
89
|
+
*/
|
|
90
|
+
timestamp(): this;
|
|
91
|
+
/**
|
|
92
|
+
* Assign type 'UNSIGNED' in table
|
|
93
|
+
* @return {this} this
|
|
94
|
+
*/
|
|
95
|
+
unsigned(): this;
|
|
96
|
+
/**
|
|
97
|
+
* Assign type 'UNIQUE' in table
|
|
98
|
+
* @return {this} this
|
|
99
|
+
*/
|
|
100
|
+
unique(): this;
|
|
101
|
+
/**
|
|
102
|
+
* Assign type 'NULL' in table
|
|
103
|
+
* @return {this} this
|
|
104
|
+
*/
|
|
105
|
+
null(): this;
|
|
106
|
+
/**
|
|
107
|
+
* Assign type 'NOT NULL' in table
|
|
108
|
+
* @return {this} this
|
|
109
|
+
*/
|
|
110
|
+
notNull(): this;
|
|
111
|
+
/**
|
|
112
|
+
* Assign type 'PRIMARY KEY' in table
|
|
113
|
+
* @return {this} this
|
|
114
|
+
*/
|
|
115
|
+
primary(): this;
|
|
116
|
+
/**
|
|
117
|
+
* Assign attrbuites 'default' in table
|
|
118
|
+
* @param {string | number} n default value
|
|
119
|
+
* @return {this} this
|
|
120
|
+
*/
|
|
121
|
+
default(n: string | number): this;
|
|
122
|
+
/**
|
|
123
|
+
* Assign attrbuites 'default currentTimestamp' in table
|
|
124
|
+
* @return {this} this
|
|
125
|
+
*/
|
|
126
|
+
currentTimestamp(): this;
|
|
127
|
+
/**
|
|
128
|
+
* Assign attrbuites 'autoIncrement' in table
|
|
129
|
+
* @return {this} this
|
|
130
|
+
*/
|
|
131
|
+
autoIncrement(): this;
|
|
132
|
+
private _addAssignType;
|
|
133
|
+
private _addAssignAttrbuite;
|
|
134
|
+
}
|
|
135
|
+
export { Blueprint };
|
|
136
|
+
export default Blueprint;
|