Provide ability to override quoter on RunnerContext
See original GitHub issueFirst of all, thanks for this awesome tool, it changed the way i’m thinking about database versioning, and i’m using in it my business app platform, Serenity.
Considering a table created with this simple migration:
Create.Table("Users")
If you run this migration in SQL server, it quotes with brackets, and in PostgreSQL it uses double quotes, nothing seems wrong so far.
But later, when you wanted to execute a very simple query:
SELECT * FROM Users
This works in SQL Server, but not PostgreSQL.
SELECT * FROM users
Again this works in SQL Server, but not PostgreSQL.
In PostgreSQL, if you put double quotes in tablename, while creating a table, not only it becomes case sensitive, you must also use double quotes while querying it, even if you use the exact same case. I don’t want to question their reasons. They probably had a very bright idea while designing this.
But i didn’t put double quotes myself, PostgreSQLQuoter did this, and i have no option to turn it off.
I just want to be able to write database-independent SQL queries (with dapper etc) at least for very simple ones, without having to quote everything.
I don’t ask you to change defaults, maybe some people are depending on this feature, but please provide a way to override default quoter of the generator. I think it should be a parameter on RunnerContext. I’ll subclass quoter, and assign it before running migrations.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:9 (2 by maintainers)
@jzabroski I will create a PR for the above mentioned feature request.
I understand quoting does force case sensitivity, I would have created a PR for that but I am extremely busy and I have temporarily used character escape. I think there should be a proper way for that and I have added a feature request for this Enable Quoted Identifier functionality for Oracle