Support multiple DB drivers – avoid global.__jacksonDb collision #3925
Reductions
started this conversation in
General
Replies: 1 comment
-
|
@Reductions Thanks. That would be great, an env config that passed noCache to the initialization of the library, uses it there and passes it down the db init (which already supports the noCache flag in the function). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1. Background
I need to store SCIM Directory-Sync data in a dedicated “slow” database (per security/audit requirements), while all SSO-related data should live in our common, high-performance production database.
2. What I’m Trying to Do
controllers({ db: … })should isolate its own connection.3. Current Behavior
controllers(...), Jackson stores the DB underglobal.__jacksonDb.controllers(...)invocations ignore the newdband reuse the one inglobal.__jacksonDb.noCacheflag indb.tsthat’s always set tofalseand not exposed. Even if you override it totrue, it only skips reading the existing cached DB but still writes the new instance into the cache—so it neither fully bypasses nor disables caching.4. Why This Is a Problem
5. What I’d Expect
dbinstance tocontrollers()should always win over any cached global.{ cacheDb: false }) or instance-scoped storage instead of global.6. Willingness to Contribute
I’m happy to implement and submit this change (e.g. expose and respect a
noCacheoption or similar) if it aligns with the project’s direction—just let me know the preferred approach!Beta Was this translation helpful? Give feedback.
All reactions