-
Notifications
You must be signed in to change notification settings - Fork 62
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
Wrap Table Names with [ ] #47
Comments
Yes, this behavior is just in SQL Server. The property |
In my case what I did was I rewrote the Identity.Dapper.SqlServer dll. Because I had to change table names, I had to modify this dll, so I just wrote my own as it is a very small dll. When I did that, I simply changed lines of such as this:
To look like this
You could resolve it in such way for your dll too, however, I must admit it would be nice being able to set Table Names outside of your dll in some way. Maybe there is and I missed it? |
You can create a class inheriting from |
Not really a fix, but 34f240c does it for the default tables now. If you want to change your table names on SQL Server, you can do:
|
Hi, I noticed that you don't wrap your table names with [ ]. By that I mean if you query on [dbo].User you will get an error because User is a reserved keyword. However if you query [dbo].[User] then it will work. In any case, I would suggest updating the scripts in the respective projects to wrap those and thus allow people to name their tables however they want without having to change your code too much.
I know you don't have that problem now because you prefixed your table names with Identity, but if I wanted to change those names to my custom names then I will basically rewrite your adapter dlls, but it would be nice not to have to rewrite too much code to make it work and only have to update the variable names where your tables are stored.
The text was updated successfully, but these errors were encountered: