Azure / Azure/Azurite

Azurite is more lenient than TableStorage when parsing a query

Open
#2,512 1 comment 0 reactions 1 assignee Claimed by @blueww View on GitHub
alignment table-query
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

Recently had an error in a non-dev environment because of the differences in how Azurite and actual table storage interprets a query.

I accidentally wrote `Or` instead of `or` in my query and azurite was fine with that, things worked, but when it was run on table storage it gave me a syntax error because the `or` has to be lowercase.

Azurite is probably more lenient because of some of the toLowerCase code found in [QueryParser.ts](https://github.com/Azure/Azurite/blob/main/src/table/persistence/QueryInterpreter/QueryParser.ts)
```typescript
private visitOr(): IQueryNode {
const left = this.visitAnd();

if (this.tokens.next(t => t.kind === "logic-operator" && t.value?.toLowerCase() === "or")) {
const right = this.visitOr();

return new OrNode(left, right);
} else {
return left;
}
}
```

Not sure where in the priority the consistency beween azurite and tablestorage in production are, since they are inherently very different technologies.
Just wanted to let you know, if it was helpful, since it had me wondering for quite a while.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.