What's this
PostgreSQL style Parser splitted from CockroachDB
See: Complex SQL format example
I tried to import github.com/cockroachdb/cockroach/pkg/sql/parser
, but the dependencies is too complex to make it work.
To make things easy, I did these things:
- Copy all the
pkg/sql/parser
,pkg/sql/lex
and simplify the dependencies - Simplify the Makefile to just generate the goyacc stuff
- Add the goyacc generated files in parser and lex to make
go get
work easily, see the.gitignore
files - Trim the
etcd
dependency, see thego.mod
- Rename all test file except some
pkg/sql/parser
tests - Add all necessary imports to vendor
- Remove the
panic
of meeting unregistried functions, see the WrapFunction - Other nasty things make the parser just work that I forgot :p
Features
- Pure golang implementation
- Almost full support of PostgreSQL (
cockroachdb
style PostgreSQL)
SQL Standard Compliance
The code is derived from CockroachDB v20.1.11 which supports most of the major features of SQL:2011. See:
🚧
🚧
🚧
still under construction
🚧
🚧
🚧
Progress
- 2020-02-16
github.com/auxten/postgresql-parser/pkg/sql/parser
Unit tests works now!
Todo
- Fix more unit tests
- Make built-in function parsing work