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
Provide ability to override quoter on RunnerContext #687
Comments
We probably need a way to enforce quoting, but it should't be enabled by default, because this would cause problems for databases like Firebird. Maybe configuration over DI would be an option too. |
With 3.0, you're able to create a new class, derived from
Whenever the Just override the |
@fubar-coder |
@a-jamil-idware Yes, you can look at where PostgresQuoter is used and add similar support for an OracleQuoter. Happy to accept a PR and get it merged quickly (within one week turnaround usually). |
Related comment: #603 (comment) explains why by default we wouldn't quote. Although, I am a bit skeptical that quoting really does force case sensitivity of variable names |
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 |
@jzabroski I will create a PR for the above mentioned feature request. |
How can I inject it using other platforms and DI Containers? I'm using .NET framework 4.6.1 and Castle Windsor. Added such code: container.Register(Component.For().ImplementedBy()); But it looks like my quoter isn't used. Queries still work only with quotes. |
@IRQ0x00 This question is way off topic for an issue closed over a year ago. Please open a new issue and follow the issue template, ideally with some reproducible code. I can't say I will try to come up with a proof-of-concept, but at minimum it may help others to post this as a Question in the Discussions area. |
First 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:
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:
This works in SQL Server, but not PostgreSQL.
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.
The text was updated successfully, but these errors were encountered: