我正在尝试使用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属性?
谢谢
克里斯托夫
答案 0 :(得分: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