# cockroachdb-parser **Repository Path**: mirrors_cockroachdb/cockroachdb-parser ## Basic Information - **Project Name**: cockroachdb-parser - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-16 - **Last Updated**: 2023-08-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cockroachdb-parser [![Go Reference](https://pkg.go.dev/badge/github.com/cockroachdb/cockroachdb-parser.svg)](https://pkg.go.dev/github.com/cockroachdb/cockroachdb-parser) [![Tests](https://github.com/cockroachdb/cockroachdb-parser/actions/workflows/go.yml/badge.svg)](https://github.com/cockroachdb/cockroachdb-parser/actions/workflows/go.yml) `cockroachdb-parser` is a snapshot of the parser package and all its dependencies from the [CockroachDB repo][repo]. The smaller package is Apache licensed and contains less dependencies to pull in when configuring compared to `go get github.com/cockroachdb/cockroach`. A README of usage of the parser library can be found [here][parserreadme]. The SHA this is based off is available in `version`. ## Versioning Versioning is done by CockroachDB version, with a `v0.` prepended. For example, `v0.22.1.0.x.y` maps to `v22.1.0` in CockroachDB, where `.x.y` maps to any subiterations. ## Custom patches There are custom patches in `patches/` which gets applied to the repo. This helps us customise the parser slightly for third party users. ## Example usage ``` import ( ... "github.com/cockroachdb/cockroachdb-parser/pkg/sql/parser" ... ) func Parse() error { ast, err := parser.ParseOne("SELECT 1") if err != nil { return err } // Do something with the AST _ = ast } ``` ## Generating a snapshot Ensure the [CockroachDB repo][repo] is cloned in your $GOPATH, and then type: ```sh ./snapshot.sh ``` [repo]: https://github.com/cockroachdb/cockroach [parserreadme]: pkg/sql/parser/README.md