Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Raw SQL Identifier Match doesn't work with multiple spaces #105

Open
tidusjar opened this issue Jul 24, 2019 · 3 comments
Open

Raw SQL Identifier Match doesn't work with multiple spaces #105

tidusjar opened this issue Jul 24, 2019 · 3 comments

Comments

@tidusjar
Copy link
Contributor

tidusjar commented Jul 24, 2019

When attempting to use the Raw SQL for the following query: select * from c order by c.id asc it does not match on the c identifier because there is a double space between the identifier and the operation (order). It seems that Github truncates the double space, but if you edit this post you can see there is a double space.

Now this is a bit of an edge case, but I found this as I was dynamically generating my order clauses and it happened to have an extra space. Ideally spacing between keywords shouldn't matter in the library since it doesn't matter to the underlying data provider.

There are the regular expressions I am referring to:
https://github.com/Elfocrash/Cosmonaut/blob/develop/src/Cosmonaut/Extensions/CosmosSqlQueryExtensions.cs#L14

@Elfocrash
Copy link
Owner

Does the underlying sdk allow multiple spaces??

@tidusjar
Copy link
Contributor Author

tidusjar commented Jul 24, 2019

I'm not sure about the underlying sdk, but querying via Azure Portal seems to allow this.

This is not really a big issue, since I've now fixed my issue to not provide any extra spaces (for the better). But I was not expecting this behavior 😄

EDIT: Also Azure Storage Explorer also allows this

@Elfocrash
Copy link
Owner

I would check how the underlying sdk reacts. It would be too tricky to write the regex for that if it’s not supported. I might pull the sql validation out of the CosmosDB sdk. I don’t consider this high priority.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants