sedentary 0.0.33 → 0.0.34
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/dist/cjs/index.js +4 -1
- package/dist/es/index.js +4 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -56,6 +56,9 @@ class Sedentary {
|
|
|
56
56
|
INT8() {
|
|
57
57
|
return new db_1.Type({ base: BigInt, size: 8, type: "INT8" });
|
|
58
58
|
}
|
|
59
|
+
NUMBER() {
|
|
60
|
+
return new db_1.Type({ base: Number, type: "NUMBER" });
|
|
61
|
+
}
|
|
59
62
|
VARCHAR(size) {
|
|
60
63
|
const message = "Sedentary.VARCHAR: 'size' argument: Wrong value, expected positive integer";
|
|
61
64
|
size = size ? this.checkSize(size, message) : undefined;
|
|
@@ -247,7 +250,7 @@ class Sedentary {
|
|
|
247
250
|
const call = (defaultValue, fieldName, notNull, unique, func, message1, message2) => {
|
|
248
251
|
if (func === this.FKEY)
|
|
249
252
|
throw new Error(`${message1} 'this.FKEY' can't be used directly`);
|
|
250
|
-
if (
|
|
253
|
+
if (![this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
|
|
251
254
|
throw new Error(`${message1} ${message2}`);
|
|
252
255
|
return new db_1.Attribute({ attributeName, defaultValue, fieldName, modelName, notNull, tableName, unique, ...func() });
|
|
253
256
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -50,6 +50,9 @@ export class Sedentary {
|
|
|
50
50
|
INT8() {
|
|
51
51
|
return new Type({ base: BigInt, size: 8, type: "INT8" });
|
|
52
52
|
}
|
|
53
|
+
NUMBER() {
|
|
54
|
+
return new Type({ base: Number, type: "NUMBER" });
|
|
55
|
+
}
|
|
53
56
|
VARCHAR(size) {
|
|
54
57
|
const message = "Sedentary.VARCHAR: 'size' argument: Wrong value, expected positive integer";
|
|
55
58
|
size = size ? this.checkSize(size, message) : undefined;
|
|
@@ -241,7 +244,7 @@ export class Sedentary {
|
|
|
241
244
|
const call = (defaultValue, fieldName, notNull, unique, func, message1, message2) => {
|
|
242
245
|
if (func === this.FKEY)
|
|
243
246
|
throw new Error(`${message1} 'this.FKEY' can't be used directly`);
|
|
244
|
-
if (
|
|
247
|
+
if (![this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
|
|
245
248
|
throw new Error(`${message1} ${message2}`);
|
|
246
249
|
return new Attribute({ attributeName, defaultValue, fieldName, modelName, notNull, tableName, unique, ...func() });
|
|
247
250
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export declare class Sedentary<D extends DB<T>, T extends Transaction> {
|
|
|
107
107
|
FKEY<N extends Natural, E extends EntryBase>(attribute: Attribute<N, E>, options?: ForeignKeyOptions): Type<N, E>;
|
|
108
108
|
INT(size?: number): Type<number, unknown>;
|
|
109
109
|
INT8(): Type<BigInt, unknown>;
|
|
110
|
+
NUMBER(): Type<number, unknown>;
|
|
110
111
|
VARCHAR(size?: number): Type<string, unknown>;
|
|
111
112
|
private checkDB;
|
|
112
113
|
private checkOrderBy;
|
package/package.json
CHANGED