Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
341 stars 44 forks source link

Using Raw SQL the order by clause is case sensitive #103

Closed tidusjar closed 5 years ago

tidusjar commented 5 years ago

When using raw sql the order by is case sensitive. Currently the library requires it to be lowercase.

I ran into this issue and it was not clear what was happening at the time until I started debugging the library.

You can see this behavior here: https://github.com/Elfocrash/Cosmonaut/blob/develop/src/Cosmonaut/Extensions/CosmosSqlQueryExtensions.cs#L41

Elfocrash commented 5 years ago

I don’t think the queries are care sensitive. The line you sent is doing a case insensitive check to check if that string exists in the query. Are you getting some specific error?

tidusjar commented 5 years ago

Sorry I updated the OP, you may not have seen the update

Elfocrash commented 5 years ago

Ok you are right, this is a bug. I saw your fix but you added "aa" as the text to replace. I guess you wanna change it to " order by " and ensure that it's a literal string case insensitive match?

If you are happy to fix that and create a pull request I'm happy to merge it. Just make sure you add some unit tests.

tidusjar commented 5 years ago

OK no problem, will do!

tidusjar commented 5 years ago

Done in PR https://github.com/Elfocrash/Cosmonaut/pull/104

Elfocrash commented 5 years ago

So it turns out there was an issue with how I was asserting string in Fluent Assertions. Check my comments in #104