-
Notifications
You must be signed in to change notification settings - Fork 75
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
base: proj/configurable-db-params
Are you sure you want to change the base?
Added support for DB Configurable Params #527
Conversation
a33527f
to
4b5f5a3
Compare
linode_api4/objects/database.py
Outdated
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
📝 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
make test-int TEST_SUITE=database/test_database_engine_config.py RUN_DB_TESTS=true