Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: QueryBuilder's TextConstraint for Postgres #15446

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

Zanzofily
Copy link

Description

When a table name or column name contains uppercase letters, both table name and column name gets wrapped between double quotes inside any TextContraint operator.

for example: Flight table name with code field name becomes "Flight.code" which results in column not found error. Instead, it should be "Flight".code, and if column name contains uppercase letters, it should be "Flight"."Code".

Example error: Undefined column: 7 ERROR: column "Flight.code" does not exist LINE 1: ...count(*) as aggregate from "Flight" where (lower("Flight.c... ^ (Connection: pgsql, SQL: select count(*) as aggregate from "Flight" where (lower("Flight.code"::text)::text like search_string%))

It might not be very common when it comes to Laravel naming conventions, but I encountered this issue while building a dashboard for an app that was initially developed with Next.js and prisma, where this naming convention is common.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@Zanzofily Zanzofily changed the title fix: QueryBuilder's TextConstraint for Postgres Fix: QueryBuilder's TextConstraint for Postgres Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant