(
collections: Iterable<Collection<T, O>>,
options?: DriverMethodOptions,
)
| 163 | } |
| 164 | |
| 165 | async syncCollections<T extends object, O extends object>( |
| 166 | collections: Iterable<Collection<T, O>>, |
| 167 | options?: DriverMethodOptions, |
| 168 | ): Promise<void> { |
| 169 | for (const coll of collections) { |
| 170 | /* v8 ignore else */ |
| 171 | if (!coll.property.owner) { |
| 172 | if (coll.getSnapshot() === undefined) { |
| 173 | throw ValidationError.cannotModifyInverseCollection(coll.owner, coll.property); |
| 174 | } |
| 175 | |
| 176 | continue; |
| 177 | } |
| 178 | |
| 179 | /* v8 ignore next */ |
| 180 | { |
| 181 | const pk = coll.property.targetMeta!.primaryKeys[0]; |
| 182 | const data = { [coll.property.name]: coll.getIdentifiers(pk) } as EntityData<T>; |
| 183 | await this.nativeUpdate<T>( |
| 184 | coll.owner.constructor, |
| 185 | helper(coll.owner).getPrimaryKey() as FilterQuery<T>, |
| 186 | data, |
| 187 | options, |
| 188 | ); |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | /** Maps raw database result to entity data, converting column names to property names. */ |
| 194 | mapResult<T extends object>( |
nothing calls this directly
no test coverage detected