-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix table casing to be the expected default (Pascal casing) #24819
Fix table casing to be the expected default (Pascal casing) #24819
Conversation
@@ -22,7 +22,7 @@ protected ConcurrencyDetectorDisabledRelationalTestBase(TFixture fixture) | |||
[MemberData(nameof(IsAsyncData))] | |||
public virtual Task FromSql(bool async) | |||
=> ConcurrencyDetectorTest(async c => async | |||
? await c.Products.FromSqlRaw("select * from products").ToListAsync() | |||
: c.Products.FromSqlRaw("select * from products").ToList()); | |||
? await c.Products.FromSqlRaw("select * from Products").ToListAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do this really properly, it should go through NormalizeDelimitersInRawString just like in #24806; PostgreSQL requires the identifier to be double-quoted here because it contains uppercase characters.
Ideally we'd have one place in a provider's test code where NormalizeDelimitersInRawString is defined (maybe in the TestHelpers implementation?), what do you think @maumar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I implement this or are we still waiting on @maumar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To unblock this PR, just define/use the method like this
efcore/test/EFCore.Relational.Specification.Tests/Query/FromSqlQueryTestBase.cs
Lines 1425 to 1426 in fb7be71
protected string NormalizeDelimitersInRawString(string sql) | |
=> Fixture.TestStore.NormalizeDelimitersInRawString(sql); |
Currently the method is defined on test store so that providers can change it as needed at the same time it is pretty DRY too. We can re-discuss later in MQ if we want to make "more" DRY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, fixed it as simply as possible. The more proper implementation would need to split the inheritance hierarchy at some point to distinguish between relational and non-relational base implementations, and would also rename a couple of classes.
@lauxjpn - Thank you. |
* Remove remnants of workaround for dotnet/efcore#25127. * Remove workaround for dotnet/efcore#24819. * Remove workaround for dotnet/efcore#24806. * Remove workaround for dotnet/efcore#19027.
For databases with case sensitive object names, the object name casing in
FromSqlRaw()
calls should be the expected default one, which is Pascal casing.