Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add db_extra_options parameter #1195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmaes
Copy link

@dmaes dmaes commented Nov 13, 2024

This PR adds a db_extra_options parameter, to allow adding custom parameters in the database.yml config.

Fixes #1194

@dmaes
Copy link
Author

dmaes commented Jan 7, 2025

@ekohl @evgeni anything still missing to get this reviewed and merged?

@dmaes dmaes force-pushed the db_extra_options branch from cbd76b2 to 98ed32c Compare January 9, 2025 14:19
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit slow getting back from the holiday break.

@@ -33,3 +34,6 @@
password: <%= stdlib::to_ruby($password) %>
<% } -%>
pool: <%= $db_pool %>
<% $extra_options.each |String $k, String $v| { -%>
<%= $k %>: <%= $v %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also use stdlib::to_ruby to ensure things are quoted if needed? I don't trust unquoted strings with random input.

@@ -33,3 +34,6 @@
password: <%= stdlib::to_ruby($password) %>
<% } -%>
pool: <%= $db_pool %>
<% $extra_options.each |String $k, String $v| { -%>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd trust the header a the top to enforce the type and avoid duplication.

Suggested change
<% $extra_options.each |String $k, String $v| { -%>
<% $extra_options.each |$k, $v| { -%>

@@ -230,6 +233,7 @@
Optional[String[1]] $db_sslmode = undef,
Optional[String[1]] $db_root_cert = undef,
Optional[Integer[0]] $db_pool = undef,
Hash[String, String] $db_extra_options = {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there options that are numbers? So something like this:

Suggested change
Hash[String, String] $db_extra_options = {},
Hash[String, Variant[String, Integer]] $db_extra_options = {},

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.

Allow more database.yml settings
2 participants