Skip to content

fix(parser): correctly handle quotes in mysql and sqlite column names#112

Merged
wsporto merged 2 commits into
wsporto:mainfrom
bertyhell:bugfix/quoted-column-names
Apr 11, 2026
Merged

fix(parser): correctly handle quotes in mysql and sqlite column names#112
wsporto merged 2 commits into
wsporto:mainfrom
bertyhell:bugfix/quoted-column-names

Conversation

@bertyhell
Copy link
Copy Markdown
Contributor

fixed for

  • mysql
  • sqlite
  • postgres (already handled this case correctly)

Added tests as well

Before this change, this valid sql:

SELECT
    autoTags.id,
    autoTags.title,
    autoTags.tagNameId,
    autoTags.priority,
    autoTags.conditions,
    tagNames.id as "tagName.id",
    tagNames.title as "tagName.title",
    tagNames.color as "tagName.color"
FROM autoTags
LEFT JOIN tagNames ON tagNames.id = autoTags.tagNameId

Would produce typescript types that are syntactically incorrect with escaped double quotes:

export type FindAllAutoTagsResult = {
	id: string;
	title: string;
	tagNameId: string;
	priority: number;
	conditions: string;
	""tagName.id"": string;
	""tagName.title"": string;
	""tagName.color"": string;
}

Now it correctly handles that case:

export type FindAllAutoTagsResult = {
	id: string;
	title: string;
	tagNameId: string;
	priority: number;
	conditions: string;
	"tagName.id": string;
	"tagName.title": string;
	"tagName.color": string;
}

@wsporto
Copy link
Copy Markdown
Owner

wsporto commented Apr 2, 2026

Thanks for the contribution!

I noticed a failing test related to quoted column names in MySQL, so I made a small fix here: fix-pr-112.

@bertyhell
Copy link
Copy Markdown
Contributor Author

looks good, i fast forwarded the branch 👍

@wsporto wsporto merged commit f035620 into wsporto:main Apr 11, 2026
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