Skip to content
Discussions/App Development/What's the difference between Daml Driver for Postgres and Daml Sandbox w/ Postgres?Forum ↗

What's the difference between Daml Driver for Postgres and Daml Sandbox w/ Postgres?

App Development7 posts920 views9 likesLast activity Mar 2021
PE
perbergmanOP
Mar 2021

If I use something like:

daml sandbox .daml/dist/example-0.0.1.dar --ledgerid daml-example-ledger --sql-backend-jdbcurl 'jdbc:postgresql://db/postgres?user=santa&password=claus'

how is that different from the DAML Driver for Postgres?

java -jar daml-on-sql-<version>.jar --ledgerid=test --sql-backend-jdbcurl='jdbc:postgresql://localhost/test?user=fred&password=secret'

Per

CO
cocreature
Mar 2021

daml sandbox’s PostgreSQL backend is deprecated and provides no guarantees on being able to upgrade the schema from one SDK version to the next which makes it relatively useless as a persistence backend.

So I’d strongly recommend using the Daml Driver for PostgreSQL instead. In terms of CLI flags it should be almost identical. The main difference is that the Daml Driver for PostgreSQL does not support implicit party allocation so you have to allocate parties explicitly via the party management service before using them.

PE
perbergman
Mar 2021

Thanks!

How do I supply the .dar file using the syntax above?

CO
cocreature
Mar 2021

I’d generally recommend against supplying DAR files on the command line when using a persistent ledger. Instead, start the ledger and then upload it via the package management service, e.g., via daml ledger upload-dar.

That said, you can supply them on startup but they’ll be ignored after the first database initialization so on restarts it will just be ignored.

java -jar daml-on-sql-version.jar 
  --ledgerid l 
  --sql-backend-jdbcurl 'jdbc:postgresql://localhost:5432/ledger?user=u&password=p'
   path/to/dar
PE
perbergman
Mar 2021

Many thanks!

Per

CO
cocreature
Mar 2021

The official, supported location for the JAR is on Github releases, e.g., https://github.com/digital-asset/daml/releases/download/v1.11.1/daml-on-sql-1.11.1.jar.

The artifact on Maven central is only a thin JAR which is not supported for external usage.

PE
perbergman
Mar 2021

Yes, found it on Release 1.11.1 · digital-asset/daml · GitHub.

Per

← Back to Discussions