Skip to content

bchong95/CosmosSQLANTLR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

CosmosSQLANTLR

ANTLR project for Cosmos DB SQL query language: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-getting-started.

Included is a sql.g4 grammar file that be used with ANTLR to generate a parser for the language of your choice.

This project has included a demo .net use case that leverages the parser and an AST to provide the following API:

string query = "SELECT * FROM c";
if (!SqlQuery.TryParse(query, out SqlQuery parsedQuery))
{
    throw new FormatException($"Failed to parse query: {query}");
}

DoSomethingWithParsedQuery(parsedQuery);

Something similar can be done with other languages that ANTLR supports.

About

ANTLR project for Cosmos DB SQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published