sedentary 0.0.32 → 0.0.33

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 CHANGED
@@ -54,7 +54,7 @@ class Sedentary {
54
54
  return new db_1.Type({ base: Number, size, type: "INT" });
55
55
  }
56
56
  INT8() {
57
- return new db_1.Type({ base: String, size: 8, type: "INT8" });
57
+ return new db_1.Type({ base: BigInt, size: 8, type: "INT8" });
58
58
  }
59
59
  VARCHAR(size) {
60
60
  const message = "Sedentary.VARCHAR: 'size' argument: Wrong value, expected positive integer";
@@ -280,6 +280,8 @@ class Sedentary {
280
280
  })();
281
281
  const { base, defaultValue } = ret;
282
282
  if (defaultValue !== undefined) {
283
+ if (base === BigInt && typeof defaultValue !== "bigint")
284
+ throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'BigInt'`);
283
285
  if (base === Date && !(defaultValue instanceof Date))
284
286
  throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'Date'`);
285
287
  if (base === Number && typeof defaultValue !== "number")
package/dist/es/index.js CHANGED
@@ -48,7 +48,7 @@ export class Sedentary {
48
48
  return new Type({ base: Number, size, type: "INT" });
49
49
  }
50
50
  INT8() {
51
- return new Type({ base: String, size: 8, type: "INT8" });
51
+ return new Type({ base: BigInt, size: 8, type: "INT8" });
52
52
  }
53
53
  VARCHAR(size) {
54
54
  const message = "Sedentary.VARCHAR: 'size' argument: Wrong value, expected positive integer";
@@ -274,6 +274,8 @@ export class Sedentary {
274
274
  })();
275
275
  const { base, defaultValue } = ret;
276
276
  if (defaultValue !== undefined) {
277
+ if (base === BigInt && typeof defaultValue !== "bigint")
278
+ throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'BigInt'`);
277
279
  if (base === Date && !(defaultValue instanceof Date))
278
280
  throw new Error(`Sedentary.model: '${modelName}' model: '${attributeName}' attribute: 'defaultValue' option: Wrong type, expected 'Date'`);
279
281
  if (base === Number && typeof defaultValue !== "number")
@@ -1,4 +1,4 @@
1
- export declare type Natural = Date | Record<string, unknown> | boolean | number | string | null;
1
+ export declare type Natural = BigInt | Date | Record<string, unknown> | boolean | number | string | null;
2
2
  export declare class EntryBase {
3
3
  constructor(from?: Partial<EntryBase>);
4
4
  construct(): void;
@@ -106,7 +106,7 @@ export declare class Sedentary<D extends DB<T>, T extends Transaction> {
106
106
  DATETIME(): Type<Date, unknown>;
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
- INT8(): Type<string, unknown>;
109
+ INT8(): Type<BigInt, unknown>;
110
110
  VARCHAR(size?: number): Type<string, unknown>;
111
111
  private checkDB;
112
112
  private checkOrderBy;
package/package.json CHANGED
@@ -9,16 +9,16 @@
9
9
  "description": "The ORM which never needs to migrate",
10
10
  "devDependencies": {
11
11
  "@types/mocha": "9.1.0",
12
- "@types/node": "17.0.23",
12
+ "@types/node": "17.0.24",
13
13
  "@types/yamljs": "0.2.31",
14
- "@typescript-eslint/eslint-plugin": "5.17.0",
15
- "@typescript-eslint/parser": "5.17.0",
16
- "eslint": "8.12.0",
14
+ "@typescript-eslint/eslint-plugin": "5.19.0",
15
+ "@typescript-eslint/parser": "5.19.0",
16
+ "eslint": "8.13.0",
17
17
  "mocha": "9.2.2",
18
18
  "nyc": "15.1.0",
19
- "prettier": "2.6.1",
19
+ "prettier": "2.6.2",
20
20
  "ts-node": "10.7.0",
21
- "tsd": "0.19.1",
21
+ "tsd": "0.20.0",
22
22
  "typescript": "4.6.3",
23
23
  "yamljs": "0.3.0"
24
24
  },
@@ -79,5 +79,5 @@
79
79
  }
80
80
  },
81
81
  "types": "./dist/types/index.d.ts",
82
- "version": "0.0.32"
82
+ "version": "0.0.33"
83
83
  }