Replies: 5 comments 9 replies
-
Maybe @adrien2p has some inputs on this? :) @friarpat - out of curiosity, what do you use this "dynamic db control" for? |
Beta Was this translation helpful? Give feedback.
-
Hello, did you find a solution for this? |
Beta Was this translation helpful? Give feedback.
-
I did not. I attempted several things…but in the end – at that time, it seemed like Medusa moved away from supporting anything “multi” with their latest version. Our timelines were too short to attempt to sway typeorm for Medusa’s needs. All of this may have changed by now? We had to abandon Medusa and go with a solution that was less desirable. Too bad, as I think there are lots of folks out there that need something like this!
From: Jesus Cervantes ***@***.***>
Sent: Wednesday, July 5, 2023 9:47 AM
To: medusajs/medusa ***@***.***>
Cc: friarpat ***@***.***>; Mention ***@***.***>
Subject: Re: [medusajs/medusa] Multi DB support in 1.8? (Discussion #3819)
Hello, did you find a solution for this?
—
Reply to this email directly, view it on GitHub <#3819 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADAICAGTM6U4O7OEJJ2FSSDXOV44VANCNFSM6AAAAAAW4GOUVQ> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/ADAICAHR4KKTEO3QMD7ECEDXOV44VA5CNFSM6AAAAAAW4GOUVSWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAMENM2.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
I'm having similar problems, and I think implementation of an option to "properly" scope modules - would bring solution a bit closer. for now my plan is to force "scoped" lifetime to all registrations in main container + override (similarly how medusa-extender did it) modules loader to implement "native" cradle usage |
Beta Was this translation helpful? Give feedback.
-
I'm willing to find a solution to implement the multi-tenancy design with Medusa, but yeah looks very hard now. it was easier with the extender but it's not here anymore. |
Beta Was this translation helpful? Give feedback.
-
Prior to 1.8, a middleware could change which database was to be accessed by the various services by doing something like:
...passing in the manager that was connected to the desired database.
As of 1.8, this functionality no longer seems to work? I can perform the above steps. I can verify in a "later" middleware that the manager in the DI is indeed pointing to the desired database. I can successfully query for data from that database using the manager from the DI.
...but getting a list of products via store/products always returns data from the default database regardless what value is in the req.scope.
Is there a new way of handling this in 1.8?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions