Christophe Roudet
Christophe Roudet

Reputation: 46

Micronaut - Configure postgres datasource

I am trying to configure the postgres datasource using micronaut-hirari. I am trying to add some postgres specific (reWriteBatchInserts) data source properties:

datasources:
  default:
    url: jdbc:postgresql://localhost/mydb
    username: <username>
    password: <pwd>
    driver-class-name: org.postgresql.Driver
    auto-commit: true
    maximum-pool-size: 50
    minimum-idle: 2
    idle-timeout: 600000
    data-source-properties: { reWriteBatchInserts: true, disableColumnSanitiser: true }

Unfortunately the properties get re-written to kebab-case:

{re-write-batch-inserts=true, disable-column-sanitiser=true}

I know that I can pass the properties in the jdbc url, but is there a way to use the data-source-properties property?

Thanks,

Christophe

Upvotes: 1

Views: 2149

Answers (1)

nikli
nikli

Reputation: 2369

Maybe it should work:

datasources:
  default:
    url: jdbc:postgresql://localhost/mydb
    username: <username>
    password: <pwd>
    driver-class-name: org.postgresql.Driver
    auto-commit: true
    maximum-pool-size: 50
    minimum-idle: 2
    idle-timeout: 600000
    data-source-properties: 
      reWriteBatchInserts: true
      disableColumnSanitiser: true 

Upvotes: 1

Related Questions