@inflector/optima-pg 1.0.9 → 1.1.1
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 +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -494,7 +494,10 @@ var Table = class {
|
|
|
494
494
|
return [k, JSON.parse(v)];
|
|
495
495
|
}
|
|
496
496
|
if (typeof v === "string" && this.isPostgresTimestamp(v)) {
|
|
497
|
-
return [
|
|
497
|
+
return [
|
|
498
|
+
k,
|
|
499
|
+
v.replace(" ", "T").replace(/\.\d+/, "").replace(/\+\d+(:\d+)?$/, "Z")
|
|
500
|
+
];
|
|
498
501
|
}
|
|
499
502
|
return [k, v];
|
|
500
503
|
})
|
|
@@ -637,7 +640,10 @@ var Table = class {
|
|
|
637
640
|
// ── Realtime ────────────────────────────────────────────────────────────────
|
|
638
641
|
Subscribe(callback) {
|
|
639
642
|
return this.listenFn(this.name, (payload) => {
|
|
640
|
-
|
|
643
|
+
const event = JSON.parse(payload);
|
|
644
|
+
if (event.new) event.new = this.deserializeRow(event.new);
|
|
645
|
+
if (event.old) event.old = this.deserializeRow(event.old);
|
|
646
|
+
callback(event);
|
|
641
647
|
});
|
|
642
648
|
}
|
|
643
649
|
};
|