sedentary 0.0.35 → 0.0.38

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
@@ -39,6 +39,9 @@ class Sedentary {
39
39
  this.log = log ? log : log === null ? () => { } : console.log;
40
40
  this.doSync = sync;
41
41
  }
42
+ BOOLEAN() {
43
+ return new db_1.Type({ base: Boolean, type: "BOOLEAN" });
44
+ }
42
45
  DATETIME() {
43
46
  return new db_1.Type({ base: Date, type: "DATETIME" });
44
47
  }
@@ -250,7 +253,7 @@ class Sedentary {
250
253
  const call = (defaultValue, fieldName, notNull, unique, func, message1, message2) => {
251
254
  if (func === this.FKEY)
252
255
  throw new Error(`${message1} 'this.FKEY' can't be used directly`);
253
- if (![this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
256
+ if (![this.BOOLEAN, this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
254
257
  throw new Error(`${message1} ${message2}`);
255
258
  return new db_1.Attribute({ attributeName, defaultValue, fieldName, modelName, notNull, tableName, unique, ...func() });
256
259
  };
package/dist/es/index.js CHANGED
@@ -33,6 +33,9 @@ export class Sedentary {
33
33
  this.log = log ? log : log === null ? () => { } : console.log;
34
34
  this.doSync = sync;
35
35
  }
36
+ BOOLEAN() {
37
+ return new Type({ base: Boolean, type: "BOOLEAN" });
38
+ }
36
39
  DATETIME() {
37
40
  return new Type({ base: Date, type: "DATETIME" });
38
41
  }
@@ -244,7 +247,7 @@ export class Sedentary {
244
247
  const call = (defaultValue, fieldName, notNull, unique, func, message1, message2) => {
245
248
  if (func === this.FKEY)
246
249
  throw new Error(`${message1} 'this.FKEY' can't be used directly`);
247
- if (![this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
250
+ if (![this.BOOLEAN, this.DATETIME, this.NUMBER, this.INT, this.INT8, this.VARCHAR].includes(func))
248
251
  throw new Error(`${message1} ${message2}`);
249
252
  return new Attribute({ attributeName, defaultValue, fieldName, modelName, notNull, tableName, unique, ...func() });
250
253
  };
@@ -103,6 +103,7 @@ export declare class Sedentary<D extends DB<T>, T extends Transaction> {
103
103
  protected log: (message: string) => void;
104
104
  private models;
105
105
  constructor(options?: SedentaryOptions);
106
+ BOOLEAN(): Type<boolean, unknown>;
106
107
  DATETIME(): Type<Date, unknown>;
107
108
  FKEY<N extends Natural, E extends EntryBase>(attribute: Attribute<N, E>, options?: ForeignKeyOptions): Type<N, E>;
108
109
  INT(size?: number): Type<number, unknown>;
package/package.json CHANGED
@@ -79,5 +79,5 @@
79
79
  }
80
80
  },
81
81
  "types": "./dist/types/index.d.ts",
82
- "version": "0.0.35"
82
+ "version": "0.0.38"
83
83
  }