Skip to content

refactor: Centralize container management in Config class#5

Merged
dpanta94 merged 13 commits into
mainfrom
fix/table-prefixes
Jul 4, 2025
Merged

refactor: Centralize container management in Config class#5
dpanta94 merged 13 commits into
mainfrom
fix/table-prefixes

Conversation

@borkweb

@borkweb borkweb commented Jul 4, 2025

Copy link
Copy Markdown
Contributor

Move container management from Provider to Config class for better separation of concerns. Add Safe_Dynamic_Prefix utility to handle table name length constraints dynamically. Update all references to use Config::get_container() instead of Provider::get_container().

Key changes:

  • Container now managed by Config class
  • Added Safe_Dynamic_Prefix utility for dynamic table prefix calculation
  • Fixed table name length constraints to respect MySQL's 64-character limit
  • Updated tests to use new container access pattern

If I recall correctly, during our review @lucatume may have suggested moving the container from Config to Provider. If that memory is correct, it didn't register fully in my head. Either way, the Config approach is what we do in our other Stellar libraries and we should stick with that.

The additional changes tweak the way the prefixes are handling to be a bit more dynamic and separate dynamic table name handling to a single class.

Move container management from Provider to Config class for better separation of concerns.
Add Safe_Dynamic_Prefix utility to handle table name length constraints dynamically.
Update all references to use Config::get_container() instead of Provider::get_container().

Key changes:
- Container now managed by Config class
- Added Safe_Dynamic_Prefix utility for dynamic table prefix calculation
- Fixed table name length constraints to respect MySQL's 64-character limit
- Updated tests to use new container access pattern

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@borkweb borkweb requested a review from dpanta94 as a code owner July 4, 2025 15:38

@dpanta94 dpanta94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like it! Left some comments

Comment thread src/Abstracts/Table_Abstract.php Outdated
Comment thread src/Config.php Outdated
Comment thread src/Provider.php Outdated
Comment thread tests/_support/Helper/test-functions.php
Comment thread src/Tables/Utility/Safe_Dynamic_Prefix.php
Comment thread src/Tables/Utility/Safe_Dynamic_Prefix.php
Comment thread src/Tables/Utility/Safe_Dynamic_Prefix.php Outdated
borkweb and others added 6 commits July 4, 2025 12:20
- Remove schema slug modification from Table_Abstract constructor
- Fix container property type hint in Config class
- Remove redundant get_container() method from Provider
- Use imported RuntimeException instead of fully qualified name

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dpanta94 dpanta94 merged commit ff3f5f8 into main Jul 4, 2025
11 checks passed
@dpanta94 dpanta94 deleted the fix/table-prefixes branch July 4, 2025 16:32
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.

2 participants