Skip to content

Add table prefix support to TableIdentifier with configurable factory#156

Open
simon-mundy wants to merge 2 commits into
php-db:0.6.xfrom
simon-mundy:issue-147
Open

Add table prefix support to TableIdentifier with configurable factory#156
simon-mundy wants to merge 2 commits into
php-db:0.6.xfrom
simon-mundy:issue-147

Conversation

@simon-mundy

Copy link
Copy Markdown
Member
Q A
Documentation yes/no
Bugfix yes/no
BC Break yes/no
New Feature yes/no
RFC yes/no
QA yes/no
House Keeping yes/no

Description

Adds optional prefix and separator parameters to TableIdentifier. When a prefix is set, getTable() and getTableAndSchema() return the prefixed table name (prefix + separator + table), so the prefix flows through all SQL generation unchanged. The separator defaults to '_' and the original name remains available via getUnprefixedTable().

Adds the callable Sql\TableIdentifierFactory, which produces identifiers carrying a preconfigured prefix/separator, and the container factory Container\TableIdentifierFactoryFactory, which reads both from the 'config' service so the prefix can be set once globally, registered in ConfigProvider.

Closes #147

Adds optional prefix and separator parameters to TableIdentifier. When a
prefix is set, getTable() and getTableAndSchema() return the prefixed
table name (prefix + separator + table), so the prefix flows through all
SQL generation unchanged. The separator defaults to '_' and the original
name remains available via getUnprefixedTable().

Adds the callable Sql\TableIdentifierFactory, which produces identifiers
carrying a preconfigured prefix/separator, and the container factory
Container\TableIdentifierFactoryFactory, which reads both from the
'config' service so the prefix can be set once globally (e.g. to create
backup_* tables during a migration). Registered in ConfigProvider.

Closes php-db#147
@simon-mundy simon-mundy added this to the 0.6.0 milestone Jul 15, 2026
@simon-mundy simon-mundy requested a review from tyrsson July 15, 2026 23:33
@simon-mundy simon-mundy self-assigned this Jul 15, 2026
@simon-mundy simon-mundy added the enhancement New feature or request label Jul 15, 2026
@simon-mundy simon-mundy added qa Improvements in quality assurance of the project next major Target next major release. labels Jul 15, 2026
@github-project-automation github-project-automation Bot moved this to Todo in @phpdb Jul 15, 2026
- Updated DDL documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request next major Target next major release. qa Improvements in quality assurance of the project

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[RFC]: Table / Schema Prefix Support

1 participant