@twin.org/entity-storage-connector-postgresql 0.10.0 → 0.10.1-next.10
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/es/postgreSqlEntityStorageConnector.js +615 -75
- package/dist/es/postgreSqlEntityStorageConnector.js.map +1 -1
- package/dist/types/postgreSqlEntityStorageConnector.d.ts +23 -2
- package/docs/changelog.md +220 -0
- package/docs/reference/classes/PostgreSqlEntityStorageConnector.md +51 -1
- package/locales/en.json +3 -2
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IHealth, type IHealthProviderComponent } from "@twin.org/api-models";
|
|
2
2
|
import { type IContextIds } from "@twin.org/context";
|
|
3
3
|
import { type EntityCondition, type IEntitySchema, SortDirection } from "@twin.org/entity";
|
|
4
|
-
import { type IEntityStorageMigrationConnector, type IMigrationOptions } from "@twin.org/entity-storage-models";
|
|
4
|
+
import { type IEntityStorageConnector, type IEntityStorageJoinOptions, type IEntityStorageMigrationConnector, type IMigrationOptions } from "@twin.org/entity-storage-models";
|
|
5
5
|
import type { IPostgreSqlEntityStorageConnectorConstructorOptions } from "./models/IPostgreSqlEntityStorageConnectorConstructorOptions.js";
|
|
6
6
|
/**
|
|
7
7
|
* Class for performing entity storage operations using ql.
|
|
@@ -115,7 +115,7 @@ export declare class PostgreSqlEntityStorageConnector<T = unknown> implements IE
|
|
|
115
115
|
*/
|
|
116
116
|
createTargetConnector<U>(entitySchemaName: string): Promise<PostgreSqlEntityStorageConnector<U>>;
|
|
117
117
|
/**
|
|
118
|
-
* Finalize the migration by
|
|
118
|
+
* Finalize the migration by dropping the source table and renaming the migration table into its name in one transaction.
|
|
119
119
|
* @param targetConnector The connector pointing to the migration table.
|
|
120
120
|
* @param options The optional migration options.
|
|
121
121
|
* @param loggingComponentType The node logging component type.
|
|
@@ -146,6 +146,27 @@ export declare class PostgreSqlEntityStorageConnector<T = unknown> implements IE
|
|
|
146
146
|
entities: Partial<T>[];
|
|
147
147
|
cursor?: string;
|
|
148
148
|
}>;
|
|
149
|
+
/**
|
|
150
|
+
* Find all the entities which match the conditions, attaching to each one the entities from a
|
|
151
|
+
* second storage connector whose join property matches. The join behaves like a left join by
|
|
152
|
+
* default, a primary entity with no matches is still returned with an empty joined list, unless
|
|
153
|
+
* joinRequired asks for an inner join and those entities are left out altogether. Both connectors
|
|
154
|
+
* must be PostgreSQL connectors reading from the same database so the work can be done in a
|
|
155
|
+
* single statement.
|
|
156
|
+
* @param joinConnector The connector holding the entities to join to.
|
|
157
|
+
* @param joinOptions The properties to join on, the conditions, sort order, projection and
|
|
158
|
+
* paging for the primary entities, the optional grouping and group conditions, and the optional
|
|
159
|
+
* conditions, sort order and projection for the joined entities.
|
|
160
|
+
* @returns All the entities for the storage matching the conditions with their joined entities,
|
|
161
|
+
* and a cursor which can be used to request more entities.
|
|
162
|
+
* @throws GeneralError if the join connector does not read from the same server and database.
|
|
163
|
+
*/
|
|
164
|
+
queryJoin<U>(joinConnector: IEntityStorageConnector<U>, joinOptions: IEntityStorageJoinOptions<T, U>): Promise<{
|
|
165
|
+
entities: (Partial<T> & {
|
|
166
|
+
joined: Partial<U>[];
|
|
167
|
+
})[];
|
|
168
|
+
cursor?: string;
|
|
169
|
+
}>;
|
|
149
170
|
/**
|
|
150
171
|
* Count all the entities which match the conditions.
|
|
151
172
|
* @param conditions The optional conditions to match for the entities.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,225 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.1-next.10](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.9...entity-storage-connector-postgresql-v0.10.1-next.10) (2026-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **entity-storage-connector-postgresql:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.9 to 0.10.1-next.10
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.9 to 0.10.1-next.10
|
|
18
|
+
|
|
19
|
+
## [0.10.1-next.9](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.8...entity-storage-connector-postgresql-v0.10.1-next.9) (2026-09-22)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* swap the migrated table into place atomically and fail loudly after an interrupted finalize ([#300](https://github.com/iotaledger/twin-entity-storage/issues/300)) ([0a59fb4](https://github.com/iotaledger/twin-entity-storage/commit/0a59fb452bafee9acfb730c0a3a3779a58fd1f3d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.8 to 0.10.1-next.9
|
|
32
|
+
* devDependencies
|
|
33
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.8 to 0.10.1-next.9
|
|
34
|
+
|
|
35
|
+
## [0.10.1-next.8](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.7...entity-storage-connector-postgresql-v0.10.1-next.8) (2026-09-22)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Miscellaneous Chores
|
|
39
|
+
|
|
40
|
+
* **entity-storage-connector-postgresql:** Synchronize repo versions
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Dependencies
|
|
44
|
+
|
|
45
|
+
* The following workspace dependencies were updated
|
|
46
|
+
* dependencies
|
|
47
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.7 to 0.10.1-next.8
|
|
48
|
+
* devDependencies
|
|
49
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.7 to 0.10.1-next.8
|
|
50
|
+
|
|
51
|
+
## [0.10.1-next.7](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.6...entity-storage-connector-postgresql-v0.10.1-next.7) (2026-09-22)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* project properties in common group join ([b90389d](https://github.com/iotaledger/twin-entity-storage/commit/b90389dd7df593b560faf2299e912c25a66bf6ee))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Dependencies
|
|
60
|
+
|
|
61
|
+
* The following workspace dependencies were updated
|
|
62
|
+
* dependencies
|
|
63
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.6 to 0.10.1-next.7
|
|
64
|
+
* devDependencies
|
|
65
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.6 to 0.10.1-next.7
|
|
66
|
+
|
|
67
|
+
## [0.10.1-next.6](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.5...entity-storage-connector-postgresql-v0.10.1-next.6) (2026-09-21)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
* join and group ([#295](https://github.com/iotaledger/twin-entity-storage/issues/295)) ([e0103b3](https://github.com/iotaledger/twin-entity-storage/commit/e0103b3af5d9d0d37d4f590c6f31993d2c7e6508))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Dependencies
|
|
76
|
+
|
|
77
|
+
* The following workspace dependencies were updated
|
|
78
|
+
* dependencies
|
|
79
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.5 to 0.10.1-next.6
|
|
80
|
+
* devDependencies
|
|
81
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.5 to 0.10.1-next.6
|
|
82
|
+
|
|
83
|
+
## [0.10.1-next.5](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.4...entity-storage-connector-postgresql-v0.10.1-next.5) (2026-09-18)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Miscellaneous Chores
|
|
87
|
+
|
|
88
|
+
* **entity-storage-connector-postgresql:** Synchronize repo versions
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### Dependencies
|
|
92
|
+
|
|
93
|
+
* The following workspace dependencies were updated
|
|
94
|
+
* dependencies
|
|
95
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.4 to 0.10.1-next.5
|
|
96
|
+
* devDependencies
|
|
97
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.4 to 0.10.1-next.5
|
|
98
|
+
|
|
99
|
+
## [0.10.1-next.4](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.3...entity-storage-connector-postgresql-v0.10.1-next.4) (2026-09-18)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Features
|
|
103
|
+
|
|
104
|
+
* add StartsWith comparison operator to all connectors ([#282](https://github.com/iotaledger/twin-entity-storage/issues/282)) ([fbb0b4a](https://github.com/iotaledger/twin-entity-storage/commit/fbb0b4a1a3d3f8ba80e8371bd2ec3a75260b9dd3))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Dependencies
|
|
108
|
+
|
|
109
|
+
* The following workspace dependencies were updated
|
|
110
|
+
* dependencies
|
|
111
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.3 to 0.10.1-next.4
|
|
112
|
+
* devDependencies
|
|
113
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.3 to 0.10.1-next.4
|
|
114
|
+
|
|
115
|
+
## [0.10.1-next.3](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.2...entity-storage-connector-postgresql-v0.10.1-next.3) (2026-09-18)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Features
|
|
119
|
+
|
|
120
|
+
* index include partitionid ([#280](https://github.com/iotaledger/twin-entity-storage/issues/280)) ([26d36e1](https://github.com/iotaledger/twin-entity-storage/commit/26d36e1c40207feb03c797b0ab00b485a1ae5cda))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Dependencies
|
|
124
|
+
|
|
125
|
+
* The following workspace dependencies were updated
|
|
126
|
+
* dependencies
|
|
127
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.2 to 0.10.1-next.3
|
|
128
|
+
* devDependencies
|
|
129
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.2 to 0.10.1-next.3
|
|
130
|
+
|
|
131
|
+
## [0.10.1-next.2](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.1...entity-storage-connector-postgresql-v0.10.1-next.2) (2026-09-17)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Miscellaneous Chores
|
|
135
|
+
|
|
136
|
+
* **entity-storage-connector-postgresql:** Synchronize repo versions
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Dependencies
|
|
140
|
+
|
|
141
|
+
* The following workspace dependencies were updated
|
|
142
|
+
* dependencies
|
|
143
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.1 to 0.10.1-next.2
|
|
144
|
+
* devDependencies
|
|
145
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.1 to 0.10.1-next.2
|
|
146
|
+
|
|
147
|
+
## [0.10.1-next.1](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.1-next.0...entity-storage-connector-postgresql-v0.10.1-next.1) (2026-09-17)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Features
|
|
151
|
+
|
|
152
|
+
* add composite indexes ([#274](https://github.com/iotaledger/twin-entity-storage/issues/274)) ([2fa6006](https://github.com/iotaledger/twin-entity-storage/commit/2fa60060633b0f20413ac106dd797b9e3763b8e4))
|
|
153
|
+
* add context id features ([#55](https://github.com/iotaledger/twin-entity-storage/issues/55)) ([99c15a2](https://github.com/iotaledger/twin-entity-storage/commit/99c15a257539b61d9da63649ce573ebf47699fc9))
|
|
154
|
+
* add ISchemaMigration chain, SchemaVersionMigrator runner and version store ([#110](https://github.com/iotaledger/twin-entity-storage/issues/110)) ([2dac924](https://github.com/iotaledger/twin-entity-storage/commit/2dac9244a752cb58304d1649ff03c3a2469783dd))
|
|
155
|
+
* add production release automation ([1eb4c8e](https://github.com/iotaledger/twin-entity-storage/commit/1eb4c8ee3eb099defdfc2d063ae44935276dcae8))
|
|
156
|
+
* add support for object comparison conditions ([eb505a1](https://github.com/iotaledger/twin-entity-storage/commit/eb505a17a3642e95c4e3cf137a77a0a8fb388c97))
|
|
157
|
+
* add validate-locales ([e66ef0d](https://github.com/iotaledger/twin-entity-storage/commit/e66ef0de26ca2f82b3fe89bb5c7a15a0978a9644))
|
|
158
|
+
* adding schema migration functionality to all the connectors ([#85](https://github.com/iotaledger/twin-entity-storage/issues/85)) ([fd1555a](https://github.com/iotaledger/twin-entity-storage/commit/fd1555a34380158214a577586dafae821e72a578))
|
|
159
|
+
* additional information in health ([1e658b7](https://github.com/iotaledger/twin-entity-storage/commit/1e658b74288e9411538286d25b81823df80703e9))
|
|
160
|
+
* common client id creation ([981452f](https://github.com/iotaledger/twin-entity-storage/commit/981452f8f75de67f082ea934801b949356763075))
|
|
161
|
+
* common client id creation ([8deb775](https://github.com/iotaledger/twin-entity-storage/commit/8deb77543c9a68a82dbdc8ca8b591607436dd231))
|
|
162
|
+
* disable endpoint discovery for cosmos ([49df2a2](https://github.com/iotaledger/twin-entity-storage/commit/49df2a254f385dc42e2e1f7e26e71f89b5bf5bcf))
|
|
163
|
+
* dynamic index addition ([65a501b](https://github.com/iotaledger/twin-entity-storage/commit/65a501b670673c245c137d6d5139f8e23a70c789))
|
|
164
|
+
* entity storage conditions ([#115](https://github.com/iotaledger/twin-entity-storage/issues/115)) ([7a53884](https://github.com/iotaledger/twin-entity-storage/commit/7a53884f6acb856d77733e4e0f23ec1c00b74cb4))
|
|
165
|
+
* entity storage enhancements ([#86](https://github.com/iotaledger/twin-entity-storage/issues/86)) ([1279af4](https://github.com/iotaledger/twin-entity-storage/commit/1279af42615c6497bb06539842cee44842dd1f75))
|
|
166
|
+
* eslint migration to flat config ([f033b64](https://github.com/iotaledger/twin-entity-storage/commit/f033b64984c0e6a8129d929c9dd816dcc1b8dab0))
|
|
167
|
+
* indexing ([#207](https://github.com/iotaledger/twin-entity-storage/issues/207)) ([2fd1f0d](https://github.com/iotaledger/twin-entity-storage/commit/2fd1f0d992344905c9dd1a44addfc4f9d5b5c168))
|
|
168
|
+
* input validation ([#162](https://github.com/iotaledger/twin-entity-storage/issues/162)) ([3e1e428](https://github.com/iotaledger/twin-entity-storage/commit/3e1e42887955cf079efd5989e197ddf8e0fa8c47))
|
|
169
|
+
* linting and dependency update ([c307b60](https://github.com/iotaledger/twin-entity-storage/commit/c307b606d03ea436b7c43d4e1764b5c08f415555))
|
|
170
|
+
* logging naming consistency ([f99d12d](https://github.com/iotaledger/twin-entity-storage/commit/f99d12dea04b6d4f2b5632ff5473e9ec7d5f9055))
|
|
171
|
+
* migration progress ([#121](https://github.com/iotaledger/twin-entity-storage/issues/121)) ([d032162](https://github.com/iotaledger/twin-entity-storage/commit/d032162768b6b7d4ccca7e39b80f8bc3ba46440e))
|
|
172
|
+
* migration property remover ([#221](https://github.com/iotaledger/twin-entity-storage/issues/221)) ([f7569ec](https://github.com/iotaledger/twin-entity-storage/commit/f7569ec44529b23d5c93789818440eb65d177570))
|
|
173
|
+
* mysql non offset paging ([#172](https://github.com/iotaledger/twin-entity-storage/issues/172)) ([0633165](https://github.com/iotaledger/twin-entity-storage/commit/063316563fa8abe221251cd34fdd6c03538b9bb3))
|
|
174
|
+
* optimistic locking ([#201](https://github.com/iotaledger/twin-entity-storage/issues/201)) ([80cbe3b](https://github.com/iotaledger/twin-entity-storage/commit/80cbe3b611c47b16328bceab02cfb8423fe1bbcd))
|
|
175
|
+
* pooled connections ([#208](https://github.com/iotaledger/twin-entity-storage/issues/208)) ([5d832d1](https://github.com/iotaledger/twin-entity-storage/commit/5d832d15b0639f13ad3f5d2c68c946a72264310a))
|
|
176
|
+
* remove default loggers ([7c8c7b1](https://github.com/iotaledger/twin-entity-storage/commit/7c8c7b132c23e95abd465c0ca3bad5ec8d95f91e))
|
|
177
|
+
* replace the connector's own legacy indexes on bootstrap ([#243](https://github.com/iotaledger/twin-entity-storage/issues/243)) ([55fd01d](https://github.com/iotaledger/twin-entity-storage/commit/55fd01d9f2ae4d9e8f523f9b8ce85dafb5a49316))
|
|
178
|
+
* string lengths ([#260](https://github.com/iotaledger/twin-entity-storage/issues/260)) ([7138ffd](https://github.com/iotaledger/twin-entity-storage/commit/7138ffd3341c514c851991ad33d4d4d2439a8469))
|
|
179
|
+
* synchronised storage ([#44](https://github.com/iotaledger/twin-entity-storage/issues/44)) ([94e10e2](https://github.com/iotaledger/twin-entity-storage/commit/94e10e26d1feec801449dc04af7a9757ac7495ff))
|
|
180
|
+
* typescript 6 update ([995a0c6](https://github.com/iotaledger/twin-entity-storage/commit/995a0c6fa9a6813bfdc7200779ce3664236e59e9))
|
|
181
|
+
* update dependencies ([7ccc0c4](https://github.com/iotaledger/twin-entity-storage/commit/7ccc0c429125d073dc60b3de6cf101abc8cc6cba))
|
|
182
|
+
* update framework core ([b59a380](https://github.com/iotaledger/twin-entity-storage/commit/b59a380bb7fba2b43610f69074dcdee24a4737da))
|
|
183
|
+
* update health signatures ([#188](https://github.com/iotaledger/twin-entity-storage/issues/188)) ([0159094](https://github.com/iotaledger/twin-entity-storage/commit/015909423958a7a20505a92b23793a044d26f6a4))
|
|
184
|
+
* use shared store mechanism ([#34](https://github.com/iotaledger/twin-entity-storage/issues/34)) ([68b6b71](https://github.com/iotaledger/twin-entity-storage/commit/68b6b71e7a96d7d016cd57bfff36775b56bf3f93))
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Bug Fixes
|
|
188
|
+
|
|
189
|
+
* adding integers types handler ([#82](https://github.com/iotaledger/twin-entity-storage/issues/82)) ([2704717](https://github.com/iotaledger/twin-entity-storage/commit/2704717fde7c0c8b39e8036b4d2a61654b51f917))
|
|
190
|
+
* adding tests and fixes for dot notation ([#76](https://github.com/iotaledger/twin-entity-storage/issues/76)) ([3879337](https://github.com/iotaledger/twin-entity-storage/commit/387933797e33543e4d8b2d49b8beeb792512a4ff))
|
|
191
|
+
* adding tests and support when neccesary for string include operator when needed ([#72](https://github.com/iotaledger/twin-entity-storage/issues/72)) ([3c723dd](https://github.com/iotaledger/twin-entity-storage/commit/3c723dd5694814398099d9d4594089dc6c66ba97))
|
|
192
|
+
* adding tests for debugging and patching the missing quotes and parse error handeling ([#61](https://github.com/iotaledger/twin-entity-storage/issues/61)) ([f746be5](https://github.com/iotaledger/twin-entity-storage/commit/f746be530799bede1db08482cf65fe780c5e75a0))
|
|
193
|
+
* allow multi-property sort on DynamoDB and CosmosDB connectors ([#196](https://github.com/iotaledger/twin-entity-storage/issues/196)) ([f1bb582](https://github.com/iotaledger/twin-entity-storage/commit/f1bb5826d75dae331ad6b42df5de330a308c5405))
|
|
194
|
+
* bound schema-migration target storage names to each backend's identifier limit ([#257](https://github.com/iotaledger/twin-entity-storage/issues/257)) ([cbf6303](https://github.com/iotaledger/twin-entity-storage/commit/cbf6303a73ac6384cfc309fbbc59ea101a82d76c))
|
|
195
|
+
* cache full connection ([#237](https://github.com/iotaledger/twin-entity-storage/issues/237)) ([1712eaa](https://github.com/iotaledger/twin-entity-storage/commit/1712eaa92ab3878ef8a8ee7fd29fa32a6fc9725e))
|
|
196
|
+
* check column coverage instead of exact index name to prevent duplicate secondary indexes ([#231](https://github.com/iotaledger/twin-entity-storage/issues/231)) ([6ca9f7f](https://github.com/iotaledger/twin-entity-storage/commit/6ca9f7fcea04a854e473042a8c2ef5c0aff80df0))
|
|
197
|
+
* dynamodb get with condition ignores primary key ([d2d0ec2](https://github.com/iotaledger/twin-entity-storage/commit/d2d0ec21023bc22f0e5a35c2d49396d90b42a4ce))
|
|
198
|
+
* dynamodb query gsi ([#140](https://github.com/iotaledger/twin-entity-storage/issues/140)) ([45b56d6](https://github.com/iotaledger/twin-entity-storage/commit/45b56d6260c9876012030cc6c85026ea84aebff5))
|
|
199
|
+
* guard against empty IN list in all SQL-style connectors ([#101](https://github.com/iotaledger/twin-entity-storage/issues/101)) ([fb2bf8b](https://github.com/iotaledger/twin-entity-storage/commit/fb2bf8beb148f0c9b92661c4899e28cd4559f39a))
|
|
200
|
+
* handle empty conditions ([#159](https://github.com/iotaledger/twin-entity-storage/issues/159)) ([ae3319c](https://github.com/iotaledger/twin-entity-storage/commit/ae3319c3136bccc94244b2d79b3baef7a1b037d7))
|
|
201
|
+
* include semantics with json conversion ([4d1f37e](https://github.com/iotaledger/twin-entity-storage/commit/4d1f37ef93eba0039c39e0f12a642565ddc28394))
|
|
202
|
+
* migration partitions ([#182](https://github.com/iotaledger/twin-entity-storage/issues/182)) ([bcbaf26](https://github.com/iotaledger/twin-entity-storage/commit/bcbaf26f11d34beabefdfcaf8101b7c234ca5ac9))
|
|
203
|
+
* null secondary indexes ([#103](https://github.com/iotaledger/twin-entity-storage/issues/103)) ([5e44f11](https://github.com/iotaledger/twin-entity-storage/commit/5e44f11bb5af5bf2c27d6f1d56aba5851116ff89))
|
|
204
|
+
* only count btree indexes as secondary index coverage on postgresql ([#240](https://github.com/iotaledger/twin-entity-storage/issues/240)) ([607d948](https://github.com/iotaledger/twin-entity-storage/commit/607d948339d22e1e69f045759af9a29b3211ba78))
|
|
205
|
+
* query params force coercion ([dd6aa87](https://github.com/iotaledger/twin-entity-storage/commit/dd6aa87efdfb60bab7d6756a86888863c45c51a7))
|
|
206
|
+
* recognise descending and compound-prefix index coverage on mongo bootstrap ([#253](https://github.com/iotaledger/twin-entity-storage/issues/253)) ([f92f72d](https://github.com/iotaledger/twin-entity-storage/commit/f92f72dec0bd81bb07b48ef6d159f5db6a17bd75))
|
|
207
|
+
* return int64 and uint64 properties as numbers on every connector ([#262](https://github.com/iotaledger/twin-entity-storage/issues/262)) ([ac85288](https://github.com/iotaledger/twin-entity-storage/commit/ac852883f4dbe97b0e844e3d094cf609e8cafbcc))
|
|
208
|
+
* route GSI sort-key conditions to KeyConditionExpression and cross-connector cursor-walk tests ([#127](https://github.com/iotaledger/twin-entity-storage/issues/127)) ([6a24e1b](https://github.com/iotaledger/twin-entity-storage/commit/6a24e1b5f3b8b426987e43da3af6766d8cb68afb))
|
|
209
|
+
* schema version check crashes in multi-tenant mode ([#192](https://github.com/iotaledger/twin-entity-storage/issues/192)) ([a816341](https://github.com/iotaledger/twin-entity-storage/commit/a8163415ce116582f3c3c23294f7f4062099d8f3))
|
|
210
|
+
* skip partition ids with mismatched depth during partition enumeration ([#218](https://github.com/iotaledger/twin-entity-storage/issues/218)) ([8fc2386](https://github.com/iotaledger/twin-entity-storage/commit/8fc238699e2891f0c982530c011fe4438004b0ae))
|
|
211
|
+
* tests and fixes for the comparisons for null and undefined ([#79](https://github.com/iotaledger/twin-entity-storage/issues/79)) ([e7ffd62](https://github.com/iotaledger/twin-entity-storage/commit/e7ffd62e9ec40ef31498e6e2350bb25d9c84638a))
|
|
212
|
+
* use hashing to restrict index name length ([757d572](https://github.com/iotaledger/twin-entity-storage/commit/757d5728161a00c1d1865ad6df3231eecfad16f2))
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Dependencies
|
|
216
|
+
|
|
217
|
+
* The following workspace dependencies were updated
|
|
218
|
+
* dependencies
|
|
219
|
+
* @twin.org/entity-storage-models bumped from 0.10.1-next.0 to 0.10.1-next.1
|
|
220
|
+
* devDependencies
|
|
221
|
+
* @twin.org/entity-storage-connector-memory bumped from 0.10.1-next.0 to 0.10.1-next.1
|
|
222
|
+
|
|
3
223
|
## [0.10.0](https://github.com/iotaledger/twin-entity-storage/compare/entity-storage-connector-postgresql-v0.10.0...entity-storage-connector-postgresql-v0.10.0) (2026-09-16)
|
|
4
224
|
|
|
5
225
|
|
|
@@ -423,7 +423,7 @@ A new connector configured with a migration table name.
|
|
|
423
423
|
|
|
424
424
|
> **finalizeMigration**\<`U`\>(`targetConnector`, `options?`, `loggingComponentType?`): `Promise`\<`PostgreSqlEntityStorageConnector`\<`U`\>\>
|
|
425
425
|
|
|
426
|
-
Finalize the migration by
|
|
426
|
+
Finalize the migration by dropping the source table and renaming the migration table into its name in one transaction.
|
|
427
427
|
|
|
428
428
|
#### Type Parameters
|
|
429
429
|
|
|
@@ -556,6 +556,56 @@ and a cursor which can be used to request more entities.
|
|
|
556
556
|
|
|
557
557
|
***
|
|
558
558
|
|
|
559
|
+
### queryJoin() {#queryjoin}
|
|
560
|
+
|
|
561
|
+
> **queryJoin**\<`U`\>(`joinConnector`, `joinOptions`): `Promise`\<\{ `entities`: `Partial`\<`T`\> & `object`[]; `cursor?`: `string`; \}\>
|
|
562
|
+
|
|
563
|
+
Find all the entities which match the conditions, attaching to each one the entities from a
|
|
564
|
+
second storage connector whose join property matches. The join behaves like a left join by
|
|
565
|
+
default, a primary entity with no matches is still returned with an empty joined list, unless
|
|
566
|
+
joinRequired asks for an inner join and those entities are left out altogether. Both connectors
|
|
567
|
+
must be PostgreSQL connectors reading from the same database so the work can be done in a
|
|
568
|
+
single statement.
|
|
569
|
+
|
|
570
|
+
#### Type Parameters
|
|
571
|
+
|
|
572
|
+
##### U
|
|
573
|
+
|
|
574
|
+
`U`
|
|
575
|
+
|
|
576
|
+
#### Parameters
|
|
577
|
+
|
|
578
|
+
##### joinConnector
|
|
579
|
+
|
|
580
|
+
`IEntityStorageConnector`\<`U`\>
|
|
581
|
+
|
|
582
|
+
The connector holding the entities to join to.
|
|
583
|
+
|
|
584
|
+
##### joinOptions
|
|
585
|
+
|
|
586
|
+
`IEntityStorageJoinOptions`\<`T`, `U`\>
|
|
587
|
+
|
|
588
|
+
The properties to join on, the conditions, sort order, projection and
|
|
589
|
+
paging for the primary entities, the optional grouping and group conditions, and the optional
|
|
590
|
+
conditions, sort order and projection for the joined entities.
|
|
591
|
+
|
|
592
|
+
#### Returns
|
|
593
|
+
|
|
594
|
+
`Promise`\<\{ `entities`: `Partial`\<`T`\> & `object`[]; `cursor?`: `string`; \}\>
|
|
595
|
+
|
|
596
|
+
All the entities for the storage matching the conditions with their joined entities,
|
|
597
|
+
and a cursor which can be used to request more entities.
|
|
598
|
+
|
|
599
|
+
#### Throws
|
|
600
|
+
|
|
601
|
+
GeneralError if the join connector does not read from the same server and database.
|
|
602
|
+
|
|
603
|
+
#### Implementation of
|
|
604
|
+
|
|
605
|
+
`IEntityStorageMigrationConnector.queryJoin`
|
|
606
|
+
|
|
607
|
+
***
|
|
608
|
+
|
|
559
609
|
### count() {#count}
|
|
560
610
|
|
|
561
611
|
> **count**(`conditions?`): `Promise`\<`number`\>
|
package/locales/en.json
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
"tableExists": "Table \"{tableName}\" created or it already exists",
|
|
8
8
|
"tableDropping": "Dropping table \"{tableName}\"",
|
|
9
9
|
"tableDropped": "Table \"{tableName}\" dropped",
|
|
10
|
-
"legacyIndexDropped": "Legacy index \"{indexName}\" dropped from table \"{tableName}\", \"{newIndexName}\"
|
|
11
|
-
"legacyIndexRenamed": "Legacy index \"{indexName}\" renamed to \"{newIndexName}\" on table \"{tableName}\""
|
|
10
|
+
"legacyIndexDropped": "Legacy index \"{indexName}\" dropped from table \"{tableName}\", \"{newIndexName}\" now covers the column"
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
"warn": {
|
|
@@ -26,6 +25,8 @@
|
|
|
26
25
|
"getFailed": "Unable to get entity \"{id}\"",
|
|
27
26
|
"removeFailed": "Unable to remove entity \"{id}\"",
|
|
28
27
|
"queryFailed": "The query failed",
|
|
28
|
+
"queryJoinFailed": "The join query failed",
|
|
29
|
+
"joinConnectorMismatch": "The join connector must be a PostgreSQL connector reading from the same server and database \"{database}\"",
|
|
29
30
|
"comparisonNotSupported": "Comparison operator \"{comparison}\" is not supported",
|
|
30
31
|
"conditionalNotSupported": "Conditional operator \"{operator}\" is not supported",
|
|
31
32
|
"entitySchemaPropertiesUndefined": "The entity schema properties are undefined",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/entity-storage-connector-postgresql",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1-next.10",
|
|
4
4
|
"description": "PostgreSQL connector for relational persistence and advanced SQL features.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"node": ">=24.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "
|
|
18
|
-
"@twin.org/context": "
|
|
19
|
-
"@twin.org/core": "
|
|
20
|
-
"@twin.org/entity": "
|
|
21
|
-
"@twin.org/entity-storage-models": "
|
|
22
|
-
"@twin.org/logging-models": "
|
|
23
|
-
"@twin.org/nameof": "
|
|
17
|
+
"@twin.org/api-models": "next",
|
|
18
|
+
"@twin.org/context": "next",
|
|
19
|
+
"@twin.org/core": "next",
|
|
20
|
+
"@twin.org/entity": "next",
|
|
21
|
+
"@twin.org/entity-storage-models": "0.10.1-next.10",
|
|
22
|
+
"@twin.org/logging-models": "next",
|
|
23
|
+
"@twin.org/nameof": "next",
|
|
24
24
|
"postgres": "3.4.9"
|
|
25
25
|
},
|
|
26
26
|
"main": "./dist/es/index.js",
|