PostgresDB configuration file with url

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

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

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)).

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?

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

1 Like