Skip to content

fix(database): convert backtick identifiers to double quotes for postgres#2093

Open
laylatichy wants to merge 2 commits intotempestphp:3.xfrom
laylatichy:fix-postgress-quoting
Open

fix(database): convert backtick identifiers to double quotes for postgres#2093
laylatichy wants to merge 2 commits intotempestphp:3.xfrom
laylatichy:fix-postgress-quoting

Conversation

@laylatichy
Copy link
Copy Markdown
Contributor

fix for #2088

…greSQL

Query::compile() stripped backtick quoting entirely for PostgreSQL,
leaving identifiers unquoted. This breaks for reserved words like
order, user, group, and type. Now converts backticks to double quotes,
which is the correct PostgreSQL identifier quoting.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

Benchmark Results

Comparison of fix-postgress-quoting against 3.x (ba925951610e8987599a77663e7d8e779b8af89d).

Open to see the benchmark results

No benchmark changes above ±5%.

Generated by phpbench against commit cc40648

@laylatichy laylatichy force-pushed the fix-postgress-quoting branch from 9b1083f to ff85d3d Compare March 30, 2026 22:55
@laylatichy laylatichy changed the title fix(database): convert backtick identifiers to double quotes for postgress fix(database): convert backtick identifiers to double quotes for postgres Mar 30, 2026
@laylatichy laylatichy force-pushed the fix-postgress-quoting branch 2 times, most recently from 5e6013d to 3147040 Compare March 30, 2026 23:18
…ements

Add DatabaseDialect::quoteIdentifier() that returns backticks for
MySQL/SQLite and double quotes for PostgreSQL. Update all QueryStatement
compile() methods to use it instead of hardcoded backticks.
Query::compile() safety net remains for __toString() paths that lack
dialect context. include UpdateStatement in quoteIdentifier refactor
@laylatichy laylatichy force-pushed the fix-postgress-quoting branch from 3147040 to cc40648 Compare March 30, 2026 23:38
@laylatichy laylatichy marked this pull request as ready for review March 30, 2026 23:56
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.

1 participant