diff --git a/cratedb_sqlparse_js/README.md b/cratedb_sqlparse_js/README.md index baf9d9c..6019bd6 100644 --- a/cratedb_sqlparse_js/README.md +++ b/cratedb_sqlparse_js/README.md @@ -14,7 +14,7 @@ CrateDB SQL Parser for JavaScript, compiled from antlr4 JavaScript compile targe ### Simple usage ```javascript -import { sqlparse } from "cratedb-sqlparse"; +import { sqlparse } from "@cratedb/cratedb-sqlparse"; const query = ` SELECT * FROM SYS.SHARDS; @@ -35,9 +35,20 @@ console.log(queries[0].original_query) // SELECT * FROM SYS.SHARDS; // INSERT INTO doc.tbl1 VALUES ('metric', 1238123, 'true'); ``` + +### CrateDB version +You can programmatically check the CrateDB version the package was compiled for in `index.js` + +```javascript +import { __cratedb_version__ } from "@cratedb/cratedb-sqlparse"; + +console.log(__cratedb_version__) +// 5.6.4 +``` + ### Features Currently, we support the same features as CrateDB java's parser: -- First class CrateDB sql dialect support. +- First class CrateDB SQL dialect support. - Input is case-insensitive. - Native errors as exceptions. - Dollar strings. @@ -45,7 +56,8 @@ Currently, we support the same features as CrateDB java's parser: Optional features: ### Errors -Errors are thrown as 'ParseError' e.g: +Errors are thrown as 'ParseError' e.g. + ```text ParseError: line2:9 mismatched input 'ROM' expecting {, ';'} ```