Skip to content

Added support for DB Configurable Params #527

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

Open
wants to merge 13 commits into
base: proj/configurable-db-params
Choose a base branch
from

Conversation

ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Apr 10, 2025

📝 Description

Implemented support for Configurable DB Params and added unit tests using mocks to test the new features.

Also, added support for custom JSON field names in dataclass fields.

✔️ How to Test

The following steps assume you have pulled down this PR locally.

Unit Tests

make test-unit

Integration Tests

NOTE: The API changes are currently only available in Alpha, so you will have to configure your environment to point to Alpha by running the following commands:

export LINODE_API_URL=https://api.dev.linode.com/v4/
export LINODE_TOKEN=<your alpha token>
export LINODE_API_CA=/path/to/your/cacert.pem

make test-int TEST_SUITE=database/test_database_engine_config.py RUN_DB_TESTS=true

@ezilber-akamai ezilber-akamai added the new-feature for new features in the changelog. label Apr 10, 2025
@ezilber-akamai ezilber-akamai force-pushed the TPT-3560-configurable-db-params branch from a33527f to 4b5f5a3 Compare April 10, 2025 17:51
@ezilber-akamai ezilber-akamai marked this pull request as ready for review April 11, 2025 15:13
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner April 11, 2025 15:13
@ezilber-akamai ezilber-akamai requested review from lgarber-akamai and ykim-akamai and removed request for a team April 11, 2025 15:13
Comment on lines 147 to 177
connect_timeout: Optional[int] = None
default_time_zone: Optional[str] = None
group_concat_max_len: Optional[float] = None
information_schema_stats_expiry: Optional[int] = None
innodb_change_buffer_max_size: Optional[int] = None
innodb_flush_neighbors: Optional[int] = None
innodb_ft_min_token_size: Optional[int] = None
innodb_ft_server_stopword_table: Optional[str] = None
innodb_lock_wait_timeout: Optional[int] = None
innodb_log_buffer_size: Optional[int] = None
innodb_online_alter_log_max_size: Optional[int] = None
innodb_print_all_deadlocks: Optional[bool] = None
innodb_read_io_threads: Optional[int] = None
innodb_rollback_on_timeout: Optional[bool] = None
innodb_thread_concurrency: Optional[int] = None
innodb_write_io_threads: Optional[int] = None
interactive_timeout: Optional[int] = None
internal_tmp_mem_storage_engine: Optional[str] = None
log_output: Optional[str] = None
long_query_time: Optional[float] = None
max_allowed_packet: Optional[int] = None
max_heap_table_size: Optional[int] = None
net_buffer_length: Optional[int] = None
net_read_timeout: Optional[int] = None
net_write_timeout: Optional[int] = None
slow_query_log: Optional[bool] = None
sort_buffer_size: Optional[int] = None
sql_mode: Optional[str] = None
sql_require_primary_key: Optional[bool] = None
tmp_table_size: Optional[int] = None
wait_timeout: Optional[int] = None
Copy link
Contributor

@lgarber-akamai lgarber-akamai Apr 11, 2025

Choose a reason for hiding this comment

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

Do these fields correspond to the fields returned by DatabaseGroup(...).mysql_config_options()?

I think having explicit fields is still the right call if so, but we also need to make sure (unit test?) users can access any fields added to that endpoint in the future. Typically I would think this is something we just update as we go, but there being a dedicated endpoint to return fields make me think these changes could happen outside of an API release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, yes, it is the same fields returned by mysql_config_options(). That endpoint returns additional information about the fields too (min, max, description, example, etc.). I would hope that new fields wouldn't be added outside of an API release but if you think that is a possibility, then I may have to rethink my design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants