Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: separate datasource and stores configuration #3811

Open
ndr-brt opened this issue Jan 30, 2024 · 1 comment
Open

refactor: separate datasource and stores configuration #3811

ndr-brt opened this issue Jan 30, 2024 · 1 comment
Labels
enhancement New feature or request refactoring Cleaning up code and dependencies
Milestone

Comments

@ndr-brt
Copy link
Member

ndr-brt commented Jan 30, 2024

Feature Request

Currently, the store and the datasource configurations are strictly tied, e.g.:

when a store like the AssetIndex one is configured, the configuration is expected this way:

edc.datasource.asset.name=asset
edc.datasource.asset.url=jdbc...
...

the configuration path would let think that this configuration regards the DataSource, that's true, but this is also telling that the SqlAssetIndex store will connect to the asset datasource, so it is not possible to declare a different DataSource for that store.

The proposal would be to add a config setting for every store like:

edc.sql.store.asset.datasource=datasourcename
edc.sql.store.policydefinition.datasource=another_datasourcename
edc.sql.store.contractnegotiation.datasource=datasourcename

so that for every store will be possible to configure a datasource defined previously, and let default be used by default, so for the majority of cases will be just enough to define a edc.datasource.default datasource and that will work by default for every store.
The edc.datasource.<context>.name could eventually be deprecated.

The refactoring would then go through the AbstractSqlStore, that currently requires both dataSourceRegistry and dataSourceName to be passed but, in fact, the dataSource could be resolved before the store initialization and be passed as a store field: there's no reason to resolve it from the registry every time a connection is needed.

Which Areas Would Be Affected?

sql

Why Is the Feature Desired?

cleanup, developer experience

Solution Proposal

If possible, provide a (brief!) solution proposal.

@ndr-brt ndr-brt added refactoring Cleaning up code and dependencies feature_request New feature request, awaiting triage triage all new issues awaiting classification enhancement New feature or request and removed feature_request New feature request, awaiting triage triage all new issues awaiting classification labels Jan 30, 2024
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale Open for x days with no activity label Feb 15, 2024
@ndr-brt ndr-brt removed the stale Open for x days with no activity label Feb 15, 2024
@ndr-brt ndr-brt added this to the Backlog milestone Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Cleaning up code and dependencies
Projects
None yet
Development

No branches or pull requests

1 participant