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

Implement MySqlHelper.EscapeString(string) #277

Closed
nvivo opened this issue Jun 21, 2017 · 3 comments
Closed

Implement MySqlHelper.EscapeString(string) #277

nvivo opened this issue Jun 21, 2017 · 3 comments

Comments

@nvivo
Copy link

nvivo commented Jun 21, 2017

There is a simple utility method that escapes strings that is present in the original driver and missing from this implementation.

MySqlHelper.EscapeString(string);

@bgrainger
Copy link
Member

It seems like this would only be used to build SQL statements by concatenating strings, which I'd normally strongly discourage (use parameterised statements instead).

However, there are some high-performance use cases (e.g., bulk-inserting tens of thousands of rows by building a SQL string) that would benefit from such a function, so I can see value in adding it.

@nvivo
Copy link
Author

nvivo commented Jun 21, 2017

Exactly, I usually create huge commands 1Mb in size each to do bulk inserts or updates in mysql, and it's much faster than using dapper with parameters. This method is handy in these cases.

@bgrainger
Copy link
Member

Added in 0.21.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants