sedentary-pg 0.0.35 → 0.0.36

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/pgdb.js CHANGED
@@ -16,12 +16,13 @@ const needDrop = [
16
16
  ["INT8", "timestamptz"]
17
17
  ];
18
18
  const needUsing = [
19
+ ["BOOLEAN", "varchar"],
19
20
  ["DATETIME", "varchar"],
20
21
  ["INT", "varchar"],
21
22
  ["INT8", "varchar"],
22
23
  ["NUMBER", "varchar"]
23
24
  ];
24
- const types = { int2: "SMALLINT", int4: "INTEGER", int8: "BIGINT", numeric: "NUMERIC", timestamptz: "DATETIME", varchar: "VARCHAR" };
25
+ const types = { bool: "BOOL", int2: "SMALLINT", int4: "INTEGER", int8: "BIGINT", numeric: "NUMERIC", timestamptz: "DATETIME", varchar: "VARCHAR" };
25
26
  const actions = { cascade: "c", "no action": "a", restrict: "r", "set default": "d", "set null": "n" };
26
27
  function parseInt8(value) {
27
28
  return BigInt(value);
@@ -285,6 +286,8 @@ class PGDB extends sedentary_1.DB {
285
286
  const { size, type } = attribute;
286
287
  let ret;
287
288
  switch (type) {
289
+ case "BOOLEAN":
290
+ return ["BOOL", "BOOL"];
288
291
  case "DATETIME":
289
292
  return ["DATETIME", "TIMESTAMP (3) WITH TIME ZONE"];
290
293
  case "NUMBER":
package/dist/es/pgdb.js CHANGED
@@ -10,12 +10,13 @@ const needDrop = [
10
10
  ["INT8", "timestamptz"]
11
11
  ];
12
12
  const needUsing = [
13
+ ["BOOLEAN", "varchar"],
13
14
  ["DATETIME", "varchar"],
14
15
  ["INT", "varchar"],
15
16
  ["INT8", "varchar"],
16
17
  ["NUMBER", "varchar"]
17
18
  ];
18
- const types = { int2: "SMALLINT", int4: "INTEGER", int8: "BIGINT", numeric: "NUMERIC", timestamptz: "DATETIME", varchar: "VARCHAR" };
19
+ const types = { bool: "BOOL", int2: "SMALLINT", int4: "INTEGER", int8: "BIGINT", numeric: "NUMERIC", timestamptz: "DATETIME", varchar: "VARCHAR" };
19
20
  const actions = { cascade: "c", "no action": "a", restrict: "r", "set default": "d", "set null": "n" };
20
21
  function parseInt8(value) {
21
22
  return BigInt(value);
@@ -283,6 +284,8 @@ export class PGDB extends DB {
283
284
  const { size, type } = attribute;
284
285
  let ret;
285
286
  switch (type) {
287
+ case "BOOLEAN":
288
+ return ["BOOL", "BOOL"];
286
289
  case "DATETIME":
287
290
  return ["DATETIME", "TIMESTAMP (3) WITH TIME ZONE"];
288
291
  case "NUMBER":
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "@types/pg": "8.6.5",
10
10
  "pg": "8.7.3",
11
11
  "pg-format": "1.0.4",
12
- "sedentary": "0.0.35"
12
+ "sedentary": "0.0.36"
13
13
  },
14
14
  "description": "The ORM which never needs to migrate - PostgreSQL",
15
15
  "devDependencies": {
@@ -84,5 +84,5 @@
84
84
  }
85
85
  },
86
86
  "types": "./dist/types/index.d.ts",
87
- "version": "0.0.35"
87
+ "version": "0.0.36"
88
88
  }