Skip to content
Discussions/App Development/PostgresDB configuration file with urlForum ↗

PostgresDB configuration file with url

App Development5 posts241 views1 likesLast activity Aug 2022
KC
kctamOP
Aug 2022

Hi team,

I just find that in canton 1.0, there is a postgres-alternative.conf inside examples/03-advanced-configuration/storage, but it no longer exists in canton 2.0.

Can we still use the configuration of postgres-alternative.conf? the reason behind is that we may need the url to pass some parameters such ssl to when accessing the postgresDB.

Kindly advise. Thanks!

kc

MA
Mate_Varga
Aug 2022

Hi KC,

You should be able to use all parameters that the underlying third party library (slick) can digest.
https://docs.daml.com/canton/usermanual/static_conf.html#persistence

Kind Regards,
Mate

MA
MatthiasSchmalz
Aug 2022

Yes, the url-based format from postgres-alternative.conf, based on java.sql.Driver is also supported.

Could you kindly let us know which parameter you prefer setting through java.sql.Driver? I’m under the impression that ssl can also be configured through PGSimpleDataSource (see PGSimpleDataSource (PostgreSQL JDBC postgresql API version 42.2.18)).

JU
Julius_William
Aug 2022

Hi @Mate_Varga

Is there a parameter in the Canton .conf file to specify where the root.cert file used for SSL connection to a db is specified?

MA
Mate_Varga
Aug 2022

Using the docs linked by @MatthiasSchmalz you can see it is called sslrootcert.

I also found this gist for an example: Play Scala and Slick 3: How to connect to postgresql database that requires certificate for connecting · GitHub

← Back to Discussions