feathers-knex
feathers-knex copied to clipboard
Add support for setting `schema` in hook params
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 infeathers-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 wheneverschema
parameter is used. This results in weirdness in the tests and an inaccurate debug statement. Not sure how to remedy without breaking thefullName
getter.
Outstanding Tasks:
- [] Document this parameter in the README.md
- [] Create a test for this usecase
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?