feathers-knex icon indicating copy to clipboard operation
feathers-knex copied to clipboard

Add support for setting `schema` in hook params

Open dyllan-to-you opened this issue 3 years ago • 1 comments

Summary

  • [X] Tell us about the problem your pull request is solving. Allow a user to set the schema a request will use by setting params.schema within a hook. This matches the API in feathers-objection

  • [ ] Are there any open issues that are related to this? No

  • [x] Is this PR dependent on PRs in other repos? No

If so, please mention them to keep the conversations linked together.

Other Information

Caveats:

  • fullName getter is inaccurate whenever schema parameter is used. This results in weirdness in the tests and an inaccurate debug statement. Not sure how to remedy without breaking the fullName getter.

Outstanding Tasks:

  • [] Document this parameter in the README.md
  • [] Create a test for this usecase

dyllan-to-you avatar Aug 14 '20 17:08 dyllan-to-you

Any update on this? I want to be able to dynamically change the schema being used based on the logged in user. I see theres an option to set the schema when defining the service currently, but that doesn't work for this scenario. Adding the ability to set the schema in a hook would allow it to dynamically be changed. Is there a better currently supported way?

joezappie avatar Jun 07 '21 20:06 joezappie