@powersync/service-module-postgres-storage 0.0.0-dev-20250122110924 → 0.0.0-dev-20250227082606

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 (36) hide show
  1. package/CHANGELOG.md +120 -12
  2. package/README.md +7 -1
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/@types/storage/PostgresBucketStorageFactory.d.ts +8 -13
  5. package/dist/@types/storage/PostgresCompactor.d.ts +0 -6
  6. package/dist/@types/storage/PostgresSyncRulesStorage.d.ts +9 -3
  7. package/dist/@types/storage/batch/PostgresBucketBatch.d.ts +7 -6
  8. package/dist/@types/types/codecs.d.ts +2 -2
  9. package/dist/@types/types/models/BucketData.d.ts +1 -1
  10. package/dist/@types/types/models/BucketParameters.d.ts +2 -2
  11. package/dist/@types/types/models/CurrentData.d.ts +3 -3
  12. package/dist/@types/types/models/SourceTable.d.ts +1 -1
  13. package/dist/@types/types/types.d.ts +5 -0
  14. package/dist/storage/PostgresBucketStorageFactory.js +68 -158
  15. package/dist/storage/PostgresBucketStorageFactory.js.map +1 -1
  16. package/dist/storage/PostgresCompactor.js +19 -6
  17. package/dist/storage/PostgresCompactor.js.map +1 -1
  18. package/dist/storage/PostgresSyncRulesStorage.js +221 -123
  19. package/dist/storage/PostgresSyncRulesStorage.js.map +1 -1
  20. package/dist/storage/batch/PostgresBucketBatch.js +31 -19
  21. package/dist/storage/batch/PostgresBucketBatch.js.map +1 -1
  22. package/dist/storage/batch/PostgresPersistedBatch.js +39 -81
  23. package/dist/storage/batch/PostgresPersistedBatch.js.map +1 -1
  24. package/dist/types/types.js.map +1 -1
  25. package/package.json +9 -9
  26. package/src/storage/PostgresBucketStorageFactory.ts +73 -179
  27. package/src/storage/PostgresCompactor.ts +19 -14
  28. package/src/storage/PostgresSyncRulesStorage.ts +231 -38
  29. package/src/storage/batch/PostgresBucketBatch.ts +39 -22
  30. package/src/storage/batch/PostgresPersistedBatch.ts +39 -81
  31. package/src/types/models/SourceTable.ts +1 -1
  32. package/src/types/types.ts +1 -0
  33. package/test/src/__snapshots__/storage_sync.test.ts.snap +138 -0
  34. package/test/src/storage.test.ts +1 -1
  35. package/test/src/storage_compacting.test.ts +1 -1
  36. package/tsconfig.json +0 -2
package/CHANGELOG.md CHANGED
@@ -1,24 +1,132 @@
1
1
  # @powersync/service-module-postgres-storage
2
2
 
3
- ## 0.0.0-dev-20250122110924
3
+ ## 0.0.0-dev-20250227082606
4
+
5
+ ### Minor Changes
6
+
7
+ - 7f8d223: Make some service limits configurable.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [7f8d223]
12
+ - @powersync/service-core-tests@0.0.0-dev-20250227082606
13
+ - @powersync/service-core@0.0.0-dev-20250227082606
14
+ - @powersync/lib-service-postgres@0.0.0-dev-20250227082606
15
+ - @powersync/service-types@0.0.0-dev-20250227082606
16
+
17
+ ## 0.4.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 88ab679: Keep serving current data when restarting replication due to errors.
22
+ - 2f75fd7: Improve handling of some edge cases which could trigger truncating of synced tables.
23
+ - 346382e: Fix issue where compacting might fail with an "unexpected PUT operation" error.
24
+ - 346382e: Unified compacting options between storage providers.
25
+ - Updated dependencies [b4fe4ae]
26
+ - Updated dependencies [88ab679]
27
+ - Updated dependencies [2f75fd7]
28
+ - Updated dependencies [346382e]
29
+ - Updated dependencies [346382e]
30
+ - Updated dependencies [9b1868d]
31
+ - @powersync/service-core@1.7.1
32
+ - @powersync/lib-services-framework@0.5.3
33
+ - @powersync/service-core-tests@0.6.0
34
+ - @powersync/lib-service-postgres@0.3.3
35
+
36
+ ## 0.4.0
37
+
38
+ ### Minor Changes
39
+
40
+ - 436eee6: Minor optimizations to new checkpoint calulations.
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [436eee6]
45
+ - Updated dependencies [15283d4]
46
+ - Updated dependencies [88d4cb3]
47
+ - Updated dependencies [f55e36a]
48
+ - @powersync/service-core-tests@0.5.0
49
+ - @powersync/service-core@1.7.0
50
+ - @powersync/service-sync-rules@0.24.0
51
+ - @powersync/lib-services-framework@0.5.2
52
+ - @powersync/lib-service-postgres@0.3.2
53
+
54
+ ## 0.3.1
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [ffc8d98]
59
+ - @powersync/service-core@0.18.1
60
+ - @powersync/service-core-tests@0.4.1
61
+
62
+ ## 0.3.0
63
+
64
+ ### Minor Changes
65
+
66
+ - 4b43cdb: Exit replication process when sync rules are not valid; configurable with a new `sync_rules.exit_on_error` option.
67
+ - 9a9e668: Target Node.JS version 22, ES2024
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [e26e434]
72
+ - Updated dependencies [4b43cdb]
73
+ - Updated dependencies [9a9e668]
74
+ - @powersync/service-sync-rules@0.23.4
75
+ - @powersync/service-core-tests@0.4.0
76
+ - @powersync/service-core@0.18.0
77
+ - @powersync/service-types@0.8.0
78
+ - @powersync/lib-services-framework@0.5.1
79
+ - @powersync/lib-service-postgres@0.3.1
80
+
81
+ ## 0.2.1
82
+
83
+ ### Patch Changes
84
+
85
+ - Updated dependencies [223f701]
86
+ - @powersync/lib-service-postgres@0.3.0
87
+
88
+ ## 0.2.0
89
+
90
+ ### Minor Changes
91
+
92
+ - 23fb49f: Allowed using the same Postgres server for the replication source and sync bucket storage. This is only supported on Postgres versions newer than 14.0.
93
+ - 23fb49f: Added the ability to skip creating empty sync checkpoints if no changes were present in a batch.
94
+
95
+ ### Patch Changes
96
+
97
+ - 23fb49f: Fix bug where listening to active checkpoint notifications on an ended connection could cause a crash.
98
+ - Updated dependencies [23fb49f]
99
+ - @powersync/service-core@0.17.0
100
+ - @powersync/service-core-tests@0.3.3
101
+
102
+ ## 0.1.2
103
+
104
+ ### Patch Changes
105
+
106
+ - Updated dependencies [5043a82]
107
+ - @powersync/service-sync-rules@0.23.3
108
+ - @powersync/service-core@0.16.1
109
+ - @powersync/service-core-tests@0.3.2
110
+
111
+ ## 0.1.1
4
112
 
5
113
  ### Patch Changes
6
114
 
7
- - a0a4cbb: Introduce standard error codes
8
- - Updated dependencies [a0a4cbb]
115
+ - f049aa9: Introduce standard error codes
116
+ - Updated dependencies [f049aa9]
9
117
  - Updated dependencies [8675236]
10
- - Updated dependencies [50e5810]
118
+ - Updated dependencies [f049aa9]
11
119
  - Updated dependencies [8675236]
12
120
  - Updated dependencies [8675236]
13
121
  - Updated dependencies [8675236]
14
- - Updated dependencies [a0a4cbb]
15
- - @powersync/service-core@0.0.0-dev-20250122110924
16
- - @powersync/service-sync-rules@0.0.0-dev-20250122110924
17
- - @powersync/service-types@0.0.0-dev-20250122110924
18
- - @powersync/lib-service-postgres@0.0.0-dev-20250122110924
19
- - @powersync/lib-services-framework@0.0.0-dev-20250122110924
20
- - @powersync/service-jpgwire@0.0.0-dev-20250122110924
21
- - @powersync/service-core-tests@0.0.0-dev-20250122110924
122
+ - Updated dependencies [f049aa9]
123
+ - @powersync/service-core@0.16.0
124
+ - @powersync/service-sync-rules@0.23.2
125
+ - @powersync/service-types@0.7.1
126
+ - @powersync/lib-service-postgres@0.2.0
127
+ - @powersync/lib-services-framework@0.5.0
128
+ - @powersync/service-jpgwire@0.19.0
129
+ - @powersync/service-core-tests@0.3.1
22
130
 
23
131
  ## 0.1.0
24
132
 
package/README.md CHANGED
@@ -31,7 +31,13 @@ storage:
31
31
  ```
32
32
 
33
33
  **IMPORTANT**:
34
- A separate Postgres server is currently required for replication connections (if using Postgres for replication) and storage. Using the same server might cause unexpected results.
34
+
35
+ Separate Postgres servers are required for replication connections **if using PostgreSQL versions below 14**.
36
+
37
+ | PostgreSQL Version | Server configuration |
38
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
39
+ | Below 14 | Separate servers are required for the source and sync bucket storage. Replication will be blocked if the same server is detected. |
40
+ | 14 and above | The source database and sync bucket storage database can be on the same server. Using the same database (with separate schemas) is supported but may lead to higher CPU usage. Using separate servers remains an option. |
35
41
 
36
42
  ### Connection credentials
37
43