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

Escape identifiers automatically #14

Open
sajithnechiparambil opened this issue Jun 20, 2019 · 3 comments
Open

Escape identifiers automatically #14

sajithnechiparambil opened this issue Jun 20, 2019 · 3 comments

Comments

@sajithnechiparambil
Copy link

column names with '[columnName]'.

Example:
SELECT [Id], [Name], [Age] FROM [Register]

@cdroulers
Copy link
Owner

@sajithnechiparambil Do you mean escape characters according to the SQL provider? Such as PostGreSQL using " around names?

@sajithnechiparambil
Copy link
Author

Yes

@cdroulers
Copy link
Owner

@sajithnechiparambil You're welcome to start a PR for this, I don't have any time to dedicate to this project these days and this is a big undertaking as well.

The columns could be easy, but this project was meant as a quick helper, for from a full SQL parser, which would be required to properly support this since the columns, order by clauses and where clauses, even from clauses would need to be parsed to properly escape them.

The basic example uses SqlStatements.Select(new[] { "u.ID", "u.Name", "u.EmailAddress" }) which would need to split on . and escape each part, same in WHERE clauses.

If I end up working on it some time, I'll try to get it done, but otherwise, I'll simply wait for a PR!

@cdroulers cdroulers changed the title Feature to add Escape identifiers automatically Jul 9, 2019
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

No branches or pull requests

2 participants