Comparing version 0.0.32 to 0.0.33
@@ -57,3 +57,3 @@ "use strict"; | ||
INT8() { | ||
return new db_1.Type({ base: String, size: 8, type: "INT8" }); | ||
return new db_1.Type({ base: BigInt, size: 8, type: "INT8" }); | ||
} | ||
@@ -284,2 +284,4 @@ VARCHAR(size) { | ||
if (defaultValue !== undefined) { | ||
if (base === BigInt && typeof defaultValue !== "bigint") | ||
throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'BigInt'`); | ||
if (base === Date && !(defaultValue instanceof Date)) | ||
@@ -286,0 +288,0 @@ throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'Date'`); |
@@ -51,3 +51,3 @@ import { Attribute, EntryBase, Table, Transaction, Type } from "./db"; | ||
INT8() { | ||
return new Type({ base: String, size: 8, type: "INT8" }); | ||
return new Type({ base: BigInt, size: 8, type: "INT8" }); | ||
} | ||
@@ -278,2 +278,4 @@ VARCHAR(size) { | ||
if (defaultValue !== undefined) { | ||
if (base === BigInt && typeof defaultValue !== "bigint") | ||
throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'BigInt'`); | ||
if (base === Date && !(defaultValue instanceof Date)) | ||
@@ -280,0 +282,0 @@ throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'Date'`); |
@@ -1,2 +0,2 @@ | ||
export declare type Natural = Date | Record<string, unknown> | boolean | number | string | null; | ||
export declare type Natural = BigInt | Date | Record<string, unknown> | boolean | number | string | null; | ||
export declare class EntryBase { | ||
@@ -3,0 +3,0 @@ constructor(from?: Partial<EntryBase>); |
@@ -109,3 +109,3 @@ import { Attribute, DB, EntryBase, ForeignKeyOptions, Natural, Transaction, Type } from "./db"; | ||
INT(size?: number): Type<number, unknown>; | ||
INT8(): Type<string, unknown>; | ||
INT8(): Type<BigInt, unknown>; | ||
VARCHAR(size?: number): Type<string, unknown>; | ||
@@ -112,0 +112,0 @@ private checkDB; |
@@ -12,12 +12,12 @@ { | ||
"@types/mocha": "9.1.0", | ||
"@types/node": "17.0.23", | ||
"@types/node": "17.0.24", | ||
"@types/yamljs": "0.2.31", | ||
"@typescript-eslint/eslint-plugin": "5.17.0", | ||
"@typescript-eslint/parser": "5.17.0", | ||
"eslint": "8.12.0", | ||
"@typescript-eslint/eslint-plugin": "5.19.0", | ||
"@typescript-eslint/parser": "5.19.0", | ||
"eslint": "8.13.0", | ||
"mocha": "9.2.2", | ||
"nyc": "15.1.0", | ||
"prettier": "2.6.1", | ||
"prettier": "2.6.2", | ||
"ts-node": "10.7.0", | ||
"tsd": "0.19.1", | ||
"tsd": "0.20.0", | ||
"typescript": "4.6.3", | ||
@@ -83,3 +83,3 @@ "yamljs": "0.3.0" | ||
"types": "./dist/types/index.d.ts", | ||
"version": "0.0.32" | ||
"version": "0.0.33" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81638
1422