Skip to content

Resolve scope names to tables via Style::realName#120

Merged
alganet merged 1 commit into
Respect:masterfrom
alganet:style-realname-boundary
Jun 27, 2026
Merged

Resolve scope names to tables via Style::realName#120
alganet merged 1 commit into
Respect:masterfrom
alganet:style-realname-boundary

Conversation

@alganet

@alganet alganet commented Jun 27, 2026

Copy link
Copy Markdown
Member

Mapper used the scope name verbatim as the SQL table and alias. Route every table emission (from/join/insertInto/update/deleteFrom) and the composition check through Style::realName, while the alias stays the PHP scope name and an AS bridges them whenever they differ — including the root table, which returned before the join-path AS logic and so could emit FROM post_tag against an undefined postTag alias for a multi-word root.

DSL calls in the tests become PHP-conventional camelCase (post_category -> postCategory); the test schema, columns and seed data stay snake_case.

Requires respect/data with Stylable::realName.

@codecov-commenter

codecov-commenter commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (4b030d4) to head (8977705).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #120   +/-   ##
=========================================
  Coverage     99.72%   99.72%           
- Complexity      149      150    +1     
=========================================
  Files             3        3           
  Lines           362      365    +3     
=========================================
+ Hits            361      364    +3     
  Misses            1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Mapper used the scope name verbatim as the SQL table and alias. Route every
table emission (from/join/insertInto/update/deleteFrom) and the composition
check through `Style::realName`, while the alias stays the PHP scope name and
an `AS` bridges them whenever they differ — including the root table, which
returned before the join-path `AS` logic and so could emit `FROM post_tag`
against an undefined `postTag` alias for a multi-word root.

DSL calls in the tests become PHP-conventional camelCase (post_category ->
postCategory); the test schema, columns and seed data stay snake_case.

Requires respect/data with Stylable::realName.
@alganet alganet force-pushed the style-realname-boundary branch from 1f5b473 to 8977705 Compare June 27, 2026 13:06
@alganet alganet merged commit 363fb5c into Respect:master Jun 27, 2026
5 checks passed
@alganet alganet deleted the style-realname-boundary branch June 27, 2026 13:07
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