@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.
- package/dist/index.js +7 -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 (
|
|
526
|
-
|
|
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) {
|