【问题标题】:Micronaut - Configure postgres datasourceMicronaut - 配置 postgres 数据源
【发布时间】:2019-01-28 17:51:47
【问题描述】:

我正在尝试使用 micronaut-hirari 配置 postgres 数据源。我正在尝试添加一些 postgres 特定的(reWriteBatchInserts)数据源属性:

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 }

不幸的是,属性被重写为 kebab-case:

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

我知道我可以通过 jdbc url 中的属性,但是有没有办法使用 data-source-properties 属性?

谢谢,

克里斯托夫

【问题讨论】:

    标签: micronaut


    【解决方案1】:

    也许它应该工作:

    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 
    

    【讨论】:

      猜你喜欢
      • 2020-08-31
      • 1970-01-01
      • 2020-10-29
      • 1970-01-01
      • 1970-01-01
      • 2019-11-24
      • 1970-01-01
      • 2020-05-25
      • 1970-01-01
      相关资源
      最近更新 更多