Description:
When PosgreySQL connector is used with Bal persist, it cannot connect to Azure hosted PostgreSQL instance out of the box.
Steps to reproduce:
Write a code using generated persist_client
Point the code to Azure hosted PostgreSQL instance (can use a private account for testing) using Config.toml file. Do not configure anything for connection options. Keep it as default.
Run the code
You will see an exception like below
error: Error in SQL connector configuration: Failed to initialize pool: FATAL: no pg_hba.conf entry for host "172.18.128.15", user "choreo_workflow_mgt_db_user", database "choreo_workflow_mgt_db", no encryption Caused by :FATAL: no pg_hba.conf entry for host "172.18.128.15", user "choreo_workflow_mgt_db_user", database "choreo_workflow_mgt_db", no encryption
Affected Versions:
Ballerina 2201.9.2
OS, DB, other environment details and versions:
MAC OS
Azure PostgreSQL
Analysis
It seems like the generated code for bal persist passes empty record by default for options. When null is passed, it works. Maybe the underneath java client sends some default options and by passing {} we just override them?
Description: When PosgreySQL connector is used with Bal persist, it cannot connect to Azure hosted PostgreSQL instance out of the box.
Steps to reproduce:
You will see an exception like below
Affected Versions:
Ballerina 2201.9.2
OS, DB, other environment details and versions:
MAC OS Azure PostgreSQL
Analysis
It seems like the generated code for bal persist passes empty record by default for options. When null is passed, it works. Maybe the underneath java client sends some default options and by passing {} we just override them?