-
I'm trying to add sql persistence to my connector for assets, policies, contracts and transfer processes. I've set up postgres databases following the schemas discribed in the corresponding sql store extension documentations. My asset configuration looks like: edc.datasource.asset.name=asset Unfortunatly I'm getting the following exception when I try to add an asset: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Fixed the problem by adding the following dependencies:
|
Beta Was this translation helpful? Give feedback.
-
Thank you, that definitely saved me a lot of time! After a little bit of testing I found that while you do indeed need org.eclipse.edc:sql-pool-apache-commons and org.postgresql:postgresql as dependencies, the rest doesn't seem to be necessary. So saving an Asset in a PostgreSQL works perfectly fine when combining the aforementioned depdencies with the org.eclipse.edc.asset-index-sql dependency. At least that's true for our setup, maybe you could tell whether that works on your side as well or not. Furthermore, it probably shouldn't be "/edc_asset" at the end of the Url but simply "/". Besides that, I'm wondering what's the correct configuration if you want to use several different sql schemas, say if you want to save the Policy as well for example. Then you'd have to use this module https://github.com/eclipse-edc/Connector/tree/main/extensions/control-plane/store/sql/policy-definition-store-sql too, but then the configuration would have to look like this: edc.datasource.asset.name=asset edc.datasource.policy.name=policy That does seem to be a little bit redundant. Does anyone have an idea why the modules are designed like this? At least there should be the possibility to set a database url only once if you want to use it for all of the available schemas. |
Beta Was this translation helpful? Give feedback.
-
In case anyone else ends up here using the search: there is now https://github.com/eclipse-edc/Connector/blob/39089d12268be753667f56c68028d428bc26a8a9/docs/developer/decision-records/2023-08-01-default-datasource/README.md, so if you don't specify separate |
Beta Was this translation helpful? Give feedback.
-
I’m trying to do it but I’m having quite a few errors. When I initialize the connector, it gives me errors that it cannot find tables "edc_transfer_process", "edc_contract_negotiation", that are indeed in the database. Later, when I try to insert an asset, policy,… I receive this message:curl -d @transfer/transfer-01-negotiation/resources/create-asset.json -H 'content-type: application/json' http://localhost:19193/management/v3/assets -s | jq HTTP ERROR 500 Internal Server Error
This is the configuration I’m doing in the build.gradle.kts and this is what I’m doing in provider-configuration.properties. edc.datasource.default.user=postgres edc.datasource.asset.name=asset edc.datasource.contractdefinition.name=contractdefinition edc.datasource.transferprocess.name=transferprocess edc.datasource.policy.name=policy |
Beta Was this translation helpful? Give feedback.
Fixed the problem by adding the following dependencies:
in addition to