feathersjs-ecosystem / feathers-objection

Feathers database adapter for Objection.js, an ORM based on KnexJS SQL query builder for Postgres, Redshift, MSSQL, MySQL, MariaDB, SQLite3, and Oracle. Forked from feathers-knex.
MIT License
98 stars 48 forks source link

upsertGraphOptions unrelate #193

Open zanzara opened 11 months ago

zanzara commented 11 months ago

It seems to be, that with latest feathers-objection 7.6.0 there is no way to set unrelate or noDelete options within the upsertGraphOptions param .

At least it has no effect. The implicit query wnat's to delete the foreign item, which leads to an ForeignKeyError due to having 'RESTRICT' in onDelete (instead of CASCDE which I don't want to have).

Overwriting the patch method of the class (better said, not to call the super.patch) and calling directly await this.options.model.query().upsertGraph({id, ...data}, {noDelete: ['roles'], unrelate: true}) does work instead in my case.

Can anyone confirm? TIA

zanzara commented 11 months ago

f-o seems to be dead as a horse can be dead.
Sry.