Skip to content
/ bq2cst Public

Parse GoogleSQL, which is a dialect of BigQuery, into a concrete syntax tree

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-THIRD-PARTY
Notifications You must be signed in to change notification settings

kitta65/bq2cst

Repository files navigation

bq2cst

Parse GoogleSQL, which is a dialect of BigQuery, into a concrete syntax tree.

Warning

This parser is designed to be used via prettier-plugin-bq.

Features

  • forcused on GoogleSQL (in other words, other SQL dialects are out of scope)
  • developed in Rust, using wasm-pack

Install

npm install bq2cst

Usage

const parser = require("bq2cst");
parser.parse("SELECT 1;")

//[
//  {
//    "token": {
//      "line":1,
//      "column":1,
//      "literal":"SELECT"
//    },
//    "node_type":"SelectStatement",
//    "children":{
//      "semicolon":{
//        "Node":{
//          "token":{"line":1,"column":9,"literal":";"},
//          "node_type":"Symbol",
//          "children":{}
//        }
//      },
//      "exprs":{
//        "NodeVec":[{
//          "token":{"line":1,"column":8,"literal":"1"},
//          "node_type":"NumericLiteral",
//          "children":{}
//        }]
//      }
//    }
//  },
//  {
//    "token":null,
//    "node_type":"EOF",
//    "children":{}
//  }
//]

About

Parse GoogleSQL, which is a dialect of BigQuery, into a concrete syntax tree

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-THIRD-PARTY

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •