prostgles-server 4.2.545 → 4.2.546
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/DboBuilder/DboBuilder.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/Functions/Functions.d.ts.map +1 -1
- package/dist/DboBuilder/QueryBuilder/Functions/Functions.js +19 -376
- package/dist/DboBuilder/QueryBuilder/Functions/Functions.js.map +1 -1
- package/dist/DboBuilder/QueryBuilder/Functions/HASHING_FUNCTIONS.d.ts +3 -0
- package/dist/DboBuilder/QueryBuilder/Functions/HASHING_FUNCTIONS.d.ts.map +1 -0
- package/dist/DboBuilder/QueryBuilder/Functions/HASHING_FUNCTIONS.js +107 -0
- package/dist/DboBuilder/QueryBuilder/Functions/HASHING_FUNCTIONS.js.map +1 -0
- package/dist/DboBuilder/QueryBuilder/Functions/TEXT_FUNCTIONS.d.ts +3 -0
- package/dist/DboBuilder/QueryBuilder/Functions/TEXT_FUNCTIONS.d.ts.map +1 -0
- package/dist/DboBuilder/QueryBuilder/Functions/TEXT_FUNCTIONS.js +276 -0
- package/dist/DboBuilder/QueryBuilder/Functions/TEXT_FUNCTIONS.js.map +1 -0
- package/dist/DboBuilder/QueryBuilder/Functions/utils.d.ts +3 -0
- package/dist/DboBuilder/QueryBuilder/Functions/utils.d.ts.map +1 -0
- package/dist/DboBuilder/QueryBuilder/Functions/utils.js +6 -0
- package/dist/DboBuilder/QueryBuilder/Functions/utils.js.map +1 -0
- package/dist/DboBuilder/TableHandler/update.js.map +1 -1
- package/dist/DboBuilder/ViewHandler/getExistsCondition.js +5 -5
- package/dist/DboBuilder/ViewHandler/getExistsCondition.js.map +1 -1
- package/dist/DboBuilder/ViewHandler/parseFieldFilter.js.map +1 -1
- package/dist/DboBuilder/runSql/runSQL.js +1 -1
- package/dist/DboBuilder/runSql/runSQL.js.map +1 -1
- package/dist/FileManager/FileManager.js.map +1 -1
- package/dist/Logging.d.ts +1 -1
- package/dist/Logging.d.ts.map +1 -1
- package/dist/PubSubManager/PubSubManager.d.ts +0 -1
- package/dist/PubSubManager/PubSubManager.d.ts.map +1 -1
- package/dist/PubSubManager/PubSubManager.js.map +1 -1
- package/dist/PubSubManager/SyncReplication/getSyncUtilFunctions.d.ts +7 -2
- package/dist/PubSubManager/SyncReplication/getSyncUtilFunctions.d.ts.map +1 -1
- package/dist/PubSubManager/SyncReplication/getSyncUtilFunctions.js +21 -16
- package/dist/PubSubManager/SyncReplication/getSyncUtilFunctions.js.map +1 -1
- package/dist/PubSubManager/SyncReplication/syncData.d.ts.map +1 -1
- package/dist/PubSubManager/SyncReplication/syncData.js +16 -14
- package/dist/PubSubManager/SyncReplication/syncData.js.map +1 -1
- package/dist/TableConfig/TableConfig.js.map +1 -1
- package/dist/runClientRequest.js +1 -1
- package/dist/runClientRequest.js.map +1 -1
- package/lib/DboBuilder/DboBuilder.ts +1 -1
- package/lib/DboBuilder/QueryBuilder/Functions/Functions.ts +142 -557
- package/lib/DboBuilder/QueryBuilder/Functions/HASHING_FUNCTIONS.ts +120 -0
- package/lib/DboBuilder/QueryBuilder/Functions/TEXT_FUNCTIONS.ts +302 -0
- package/lib/DboBuilder/QueryBuilder/Functions/utils.ts +3 -0
- package/lib/DboBuilder/TableHandler/update.ts +1 -1
- package/lib/DboBuilder/ViewHandler/getExistsCondition.ts +4 -4
- package/lib/DboBuilder/ViewHandler/parseFieldFilter.ts +1 -1
- package/lib/DboBuilder/runSql/runSQL.ts +1 -1
- package/lib/FileManager/FileManager.ts +1 -1
- package/lib/Logging.ts +1 -1
- package/lib/PubSubManager/PubSubManager.ts +0 -1
- package/lib/PubSubManager/SyncReplication/getSyncUtilFunctions.ts +28 -19
- package/lib/PubSubManager/SyncReplication/syncData.ts +16 -14
- package/lib/TableConfig/TableConfig.ts +1 -1
- package/lib/runClientRequest.ts +1 -1
- package/package.json +2 -2
|
@@ -59,7 +59,7 @@ export async function syncData(
|
|
|
59
59
|
tableName: sync.table_name,
|
|
60
60
|
sid: sync.sid,
|
|
61
61
|
source,
|
|
62
|
-
...pickKeys(sync, ["socket_id", "condition", "
|
|
62
|
+
...pickKeys(sync, ["socket_id", "condition", "lr", "is_syncing"]),
|
|
63
63
|
lr: JSON.stringify(sync.lr),
|
|
64
64
|
connectedSocketIds: this.dboBuilder.prostgles.connectedSockets.map((s) => s.id),
|
|
65
65
|
localParams: undefined,
|
|
@@ -111,11 +111,13 @@ export async function syncData(
|
|
|
111
111
|
sync.is_syncing = true;
|
|
112
112
|
},
|
|
113
113
|
onSend: async (data) => {
|
|
114
|
-
const res = await upsertData(data);
|
|
114
|
+
const res = await upsertData(data, "WAL");
|
|
115
115
|
return res;
|
|
116
116
|
},
|
|
117
|
-
onSendEnd: (batch) => {
|
|
118
|
-
|
|
117
|
+
onSendEnd: (batch, _, error) => {
|
|
118
|
+
if (error === undefined) {
|
|
119
|
+
updateSyncLR(batch);
|
|
120
|
+
}
|
|
119
121
|
sync.is_syncing = false;
|
|
120
122
|
|
|
121
123
|
/**
|
|
@@ -126,13 +128,13 @@ export async function syncData(
|
|
|
126
128
|
});
|
|
127
129
|
|
|
128
130
|
/* Debounce sync requests */
|
|
129
|
-
if (!sync.wal.isSending() && sync.is_syncing) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
131
|
+
// if (!sync.wal.isSending() && sync.is_syncing) {
|
|
132
|
+
// this.syncTimeout ??= setTimeout(() => {
|
|
133
|
+
// this.syncTimeout = undefined;
|
|
134
|
+
// void this.syncData(sync, undefined, source);
|
|
135
|
+
// }, throttle);
|
|
136
|
+
// return;
|
|
137
|
+
// }
|
|
136
138
|
|
|
137
139
|
/**
|
|
138
140
|
* Express data sent from a client that has already been synced
|
|
@@ -170,8 +172,8 @@ export async function syncData(
|
|
|
170
172
|
|
|
171
173
|
/* Make sure trigger is not firing on freshly synced data */
|
|
172
174
|
if (!rowsFullyMatch(sync.lr, s_lr)) {
|
|
173
|
-
from_synced = sync.
|
|
174
|
-
await logSyncData("sync.
|
|
175
|
+
from_synced = Number(sync.lr[synced_field]);
|
|
176
|
+
await logSyncData("sync.lr");
|
|
175
177
|
} else {
|
|
176
178
|
await logSyncData("rowsFullyMatch");
|
|
177
179
|
}
|
|
@@ -189,7 +191,7 @@ export async function syncData(
|
|
|
189
191
|
await logSyncData("nothingToSync");
|
|
190
192
|
}
|
|
191
193
|
|
|
192
|
-
await pushData(
|
|
194
|
+
await pushData({ state: "synced" });
|
|
193
195
|
|
|
194
196
|
sync.is_syncing = false;
|
|
195
197
|
}
|
|
@@ -537,7 +537,7 @@ export default class TableConfigurator {
|
|
|
537
537
|
): Promise<AnyObject> => {
|
|
538
538
|
const tableHook = this.config[tableHandler.name]?.hooks?.getPreInsertRow;
|
|
539
539
|
if (tableHandler.is_media) {
|
|
540
|
-
return uploadFile.bind(tableHandler)(args)
|
|
540
|
+
return uploadFile.bind(tableHandler)(args);
|
|
541
541
|
}
|
|
542
542
|
if (tableHook) {
|
|
543
543
|
return tableHook(args);
|
package/lib/runClientRequest.ts
CHANGED
|
@@ -169,7 +169,7 @@ export const clientCanRunSqlRequest = async function (
|
|
|
169
169
|
const allowedToRunSQL =
|
|
170
170
|
publishParams &&
|
|
171
171
|
(await (
|
|
172
|
-
this.opts.publishRawSQL
|
|
172
|
+
this.opts.publishRawSQL
|
|
173
173
|
)?.(publishParams));
|
|
174
174
|
return allowedToRunSQL === true || allowedToRunSQL === "*";
|
|
175
175
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prostgles-server",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.546",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"pg": "^8.21.0",
|
|
58
58
|
"pg-cursor": "^2.20.0",
|
|
59
59
|
"pg-promise": "^12.6.2",
|
|
60
|
-
"prostgles-types": "^4.0.
|
|
60
|
+
"prostgles-types": "^4.0.264"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@eslint/js": "^9.22.0",
|