Skip to content

Generated SQL is having quotes in Table alias name even though unquoted alias name is provided. #7565

@BidyadharM

Description

@BidyadharM

GORM Playground Link

go-gorm/playground#826

Description

Testing with gorm-oracle:
When the alias name is provided unquoted, the alias name used when generating the query should be unquoted as well.
For the below statement,

DB.Table("users u").Where("u.\"name\" = ?", "Bob").First(&result);

the generated query is:
SELECT * FROM users u WHERE u."name" = "Bob" AND "u"."deleted_at" IS NULL ORDER BY "u"."id" LIMIT 1

it should be:
SELECT * FROM users u WHERE u."name" = "Bob" AND u."deleted_at" IS NULL ORDER BY u."id" LIMIT 1

as oracle handles the quoted and unquoted indentifiers as separare entity.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions