Skip to content
Discussions/App Development/DAML postgreSQL new connectForum ↗

DAML postgreSQL new connect

App Development2 posts158 viewsLast activity Jun 2023
TE
Teja_SatyaOP
Jun 2023

Hi Team,

I have postgreSQL running in my local on port 5432 which has a table called employees with the following details

when i exercise a choice in a contract
i want to make a db call and get the details based on the query, so that i will
create a new contract of another template based on the retrieved values.

Thank you in advance :slight_smile:

ST
Stephen
Jun 2023

To form a verifiable ledger model, it is not possible to interact with a SQL database, or any other external resource, directly from a Daml choice execution. See more details about what to do in this case in this previous answer:

Not at the moment, no. The Daml language is currently focused on interacting with the ledger, either from within a participant (contract choices) or from an external “reactive” mechanism (triggers), but in either case the only effects the language can produce is to either read from or write to the ledger. If you need to bridge the outside world to your ledger, you’ll have to write code in a general purpose language and use either the gRPC API or the HTTP API. You can use any language with gen…
← Back to Discussions