Skip to content

use hasKey/ternary for boolean values with defaults#96

Open
frodsan wants to merge 2 commits into
pgdogdev:mainfrom
frodsan:fix-boolean-defaults
Open

use hasKey/ternary for boolean values with defaults#96
frodsan wants to merge 2 commits into
pgdogdev:mainfrom
frodsan:fix-boolean-defaults

Conversation

@frodsan
Copy link
Copy Markdown
Contributor

@frodsan frodsan commented May 12, 2026

Problem

We are passing the following config:

logConnections    = false
logDisconnections = false

but the generated .toml file still sets the defaults:

log_connections = true
log_disconnections = true

It seems like boolean values using | default always evaluated to their default, even when explicitly set to false. So false | default "true" returns "true" (the default) instead of the passed value.

Solution

Replace | default with hasKey ... | ternary for all boolean fields. This checks whether the key was explicitly provided rather than relying on truthiness:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant