python-injector / python-injector/injector

Question: Possible to have "named" instances

Open
#69 1 comment 3 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.