parse-server 5.0.0-alpha.12 → 5.0.0-alpha.16
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/README.md +23 -6
- package/lib/Adapters/Storage/Mongo/MongoTransform.js +4 -135
- package/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js +50 -8
- package/lib/Controllers/DatabaseController.js +26 -16
- package/lib/Controllers/index.js +5 -3
- package/lib/Utils.js +140 -1
- package/lib/middlewares.js +4 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -134,10 +134,10 @@ Parse Server is continuously tested with the most recent releases of PostgreSQL
|
|
|
134
134
|
|
|
135
135
|
| Version | PostGIS Version | End-of-Life | Parse Server Support End | Compatible |
|
|
136
136
|
|-------------|-----------------|---------------|--------------------------|------------|
|
|
137
|
-
| Postgres 11 | 3.0, 3.1
|
|
138
|
-
| Postgres 12 | 3.
|
|
139
|
-
| Postgres 13 | 3.
|
|
140
|
-
| Postgres 14 | 3.
|
|
137
|
+
| Postgres 11 | 3.0, 3.1, 3.2 | November 2023 | April 2022 | ✅ Yes |
|
|
138
|
+
| Postgres 12 | 3.2 | November 2024 | April 2023 | ✅ Yes |
|
|
139
|
+
| Postgres 13 | 3.2 | November 2025 | April 2024 | ✅ Yes |
|
|
140
|
+
| Postgres 14 | 3.2 | November 2026 | April 2025 | ✅ Yes |
|
|
141
141
|
|
|
142
142
|
### Locally
|
|
143
143
|
```bash
|
|
@@ -525,9 +525,26 @@ let api = new ParseServer({
|
|
|
525
525
|
| `idempotencyOptions.paths` | yes | `Array<String>` | `[]` | `.*` (all paths, includes the examples below), <br>`functions/.*` (all functions), <br>`jobs/.*` (all jobs), <br>`classes/.*` (all classes), <br>`functions/.*` (all functions), <br>`users` (user creation / update), <br>`installations` (installation creation / update) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS | An array of path patterns that have to match the request path for request deduplication to be enabled. The mount path must not be included, for example to match the request path `/parse/functions/myFunction` specify the path pattern `functions/myFunction`. A trailing slash of the request path is ignored, for example the path pattern `functions/myFunction` matches both `/parse/functions/myFunction` and `/parse/functions/myFunction/`. |
|
|
526
526
|
| `idempotencyOptions.ttl` | yes | `Integer` | `300` | `60` (60 seconds) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL | The duration in seconds after which a request record is discarded from the database. Duplicate requests due to network issues can be expected to arrive within milliseconds up to several seconds. This value must be greater than `0`. |
|
|
527
527
|
|
|
528
|
-
###
|
|
528
|
+
### Postgres <!-- omit in toc -->
|
|
529
|
+
|
|
530
|
+
To use this feature in Postgres, you will need to create a cron job using [pgAdmin](https://www.pgadmin.org/docs/pgadmin4/development/pgagent_jobs.html) or similar to call the Postgres function `idempotency_delete_expired_records()` that deletes expired idempotency records. You can find an example script below. Make sure the script has the same privileges to log into Postgres as Parse Server.
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
#!/bin/bash
|
|
534
|
+
|
|
535
|
+
set -e
|
|
536
|
+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
537
|
+
SELECT idempotency_delete_expired_records();
|
|
538
|
+
EOSQL
|
|
529
539
|
|
|
530
|
-
|
|
540
|
+
exec "$@"
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Assuming the script above is named, `parse_idempotency_delete_expired_records.sh`, a cron job that runs the script every 2 minutes may look like:
|
|
544
|
+
|
|
545
|
+
```bash
|
|
546
|
+
2 * * * * /root/parse_idempotency_delete_expired_records.sh >/dev/null 2>&1
|
|
547
|
+
```
|
|
531
548
|
|
|
532
549
|
## Localization
|
|
533
550
|
|