@inflector/optima 1.0.18 → 1.0.19

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -522,8 +522,12 @@ var OptimaTable = class _OptimaTable {
522
522
  const orderedValues = columnKeys.map((key) => {
523
523
  let v = r[key];
524
524
  if (v == null) {
525
- if (typeof this.Columns[key].config.default === "function") {
526
- v = this.Columns[key].config.default();
525
+ if (this.Columns[key].config.default !== void 0) {
526
+ if (typeof this.Columns[key].config.default === "function") {
527
+ v = this.Columns[key].config.default();
528
+ } else {
529
+ v = this.Columns[key].config.default;
530
+ }
527
531
  } else if (this.Columns[key].config.defaultNow) {
528
532
  v = /* @__PURE__ */ new Date();
529
533
  }
@@ -671,6 +675,7 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
671
675
  this.Validate(record);
672
676
  record = this.Transform(record);
673
677
  const { sql } = this.BuildInsert(this.Name, [record], data.returning);
678
+ console.log(sql);
674
679
  const Result = await (await this.Connection.run(sql)).getRowObjects();
675
680
  const Res = this.FormatOut(Result);
676
681
  if (Res.length != 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflector/optima",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "author": "Inflector",
6
6
  "main": "./dist/index.js",