python-injector / python-injector/injector
Question: Possible to have "named" instances
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Hi there, first of all thanks for providing a great project here, coming from c# background, its been the backbone of all of my python projects so far.
At the moment I have a bit of an interesting problem to resolve and wondering if this is possible.
I have created a service layer project which takes a database object, which normally i just inject etc.
However for this new project, I have to show an overall system, that talks to two of these databases, each for a different company, but they have the same structure.
Since I have it separated out as a service project layer, I'm struggling to see how I can inject in my singleton database objects. ( two different ones) and how to differentiate when I want to talk to database a or database b.
Any Ideas?
Thanks
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the issue's request for two database instances with the same structure and how the service layer would distinguish them. Determine whether the project already documents or supports named instances; done would be a clear answer or a defined implementation scope, but no files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100