deprecate: Raise deprecation levels of API property setters #2209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary of the change: Raise the deprecation levels of property setters that were deprecated after
DatabaseConfig
was implemented. The deprecation level has remained untouched because they were being used for testing purposes.Detailed description:
The following elements have been deprecated since around 0.35.1 ->
Raise from WARNING to ERROR:
Database.useNestedTransactions
Database.defaultFetchSize
ThreadLocalTransactionManager.defaultIsolationLevel
Why: [Test refactoring]
For the last remaining property used in tests, the only current alternative to setting the deprecated property would be to either store a configured
Database.connect()
instance in a variable or useTestDB.connect { setter }
. Both then require using new transaction blocks and manually creating and dropping tables, which becomes tedious if multiple tables and dialects are being tested.How:
DatabaseTestsBase
methods,withDb()
,withTables()
, andwithSchemas()
, now have a parameter that accepts a configuration builder, which is more easily passed to the call toconnect()
.Some logic has been added to base
withDb()
to make sure that any database that stays registered for the entire test suite only retains the set configuration for that single call.Type of Change
Please mark the relevant options with an "X":
Affected databases:
Checklist
Related Issues