@@ -4,10 +4,10 @@ Go package for parsing MySQL SQL queries.
44
55## Notice
66
7- The backbone of this repo is extracted from [ youtube /vitess] ( https://github.com/youtube /vitess ) .
7+ The backbone of this repo is extracted from [ vitessio /vitess] ( https://github.com/vitessio /vitess ) .
88
9- Inside youtube /vitess there is a very nicely written sql parser. However as it's not a self-contained application, I created this one.
10- It applies the same LICENSE as youtube /vitess.
9+ Inside vitessio /vitess there is a very nicely written sql parser. However as it's not a self-contained application, I created this one.
10+ It applies the same LICENSE as vitessio /vitess.
1111
1212## Usage
1313
@@ -54,13 +54,13 @@ See [parse_test.go](https://github.com/xwb1989/sqlparser/blob/master/parse_test.
5454
5555## Porting Instructions
5656
57- You only need the below if you plan to try and keep this library up to date with [ youtube /vitess] ( https://github.com/youtube /vitess ) .
57+ You only need the below if you plan to try and keep this library up to date with [ vitessio /vitess] ( https://github.com/vitessio /vitess ) .
5858
5959### Keeping up to date
6060
6161``` bash
6262shopt -s nullglob
63- VITESS=${GOPATH?} /src/github.com/youtube /vitess/go/
63+ VITESS=${GOPATH?} /src/github.com/vitessio /vitess/go/
6464XWB1989=${GOPATH?} /src/github.com/xwb1989/sqlparser/
6565
6666# Create patches for everything that changed
@@ -92,26 +92,28 @@ rm ${VITESS?}/{sqltypes,bytes2,hack}/*.patch ${VITESS?}/*.patch
9292
9393### Fresh install
9494
95+ TODO: Change these instructions to use git to copy the files, that'll make later patching easier.
96+
9597``` bash
9698cd $GOPATH /src/github.com/xwb1989/sqlparser
9799
98100# Copy all the code
99- cp -pr ../../youtube /vitess/go/vt/sqlparser/ .
100- cp -pr ../../youtube /vitess/go/sqltypes dependency
101- cp -pr ../../youtube /vitess/go/bytes2 dependency
102- cp -pr ../../youtube /vitess/go/hack dependency
101+ cp -pr ../../vitessio /vitess/go/vt/sqlparser/ .
102+ cp -pr ../../vitessio /vitess/go/sqltypes dependency
103+ cp -pr ../../vitessio /vitess/go/bytes2 dependency
104+ cp -pr ../../vitessio /vitess/go/hack dependency
103105
104106# Delete some code we haven't ported
105107rm dependency/sqltypes/arithmetic.go dependency/sqltypes/arithmetic_test.go dependency/sqltypes/event_token.go dependency/sqltypes/event_token_test.go dependency/sqltypes/proto3.go dependency/sqltypes/proto3_test.go dependency/sqltypes/query_response.go dependency/sqltypes/result.go dependency/sqltypes/result_test.go
106108
107109# Some automated fixes
108110
109111# Fix imports
110- sed -i ' .bak' ' s_github.com/youtube /vitess/go/vt/proto/query_github.com/xwb1989/sqlparser/dependency/querypb_g' * .go dependency/sqltypes/* .go
111- sed -i ' .bak' ' s_github.com/youtube /vitess/go/_github.com/xwb1989/sqlparser/dependency/_g' * .go dependency/sqltypes/* .go
112+ sed -i ' .bak' ' s_github.com/vitessio /vitess/go/vt/proto/query_github.com/xwb1989/sqlparser/dependency/querypb_g' * .go dependency/sqltypes/* .go
113+ sed -i ' .bak' ' s_github.com/vitessio /vitess/go/_github.com/xwb1989/sqlparser/dependency/_g' * .go dependency/sqltypes/* .go
112114
113115# Copy the proto, but basically drop everything we don't want
114- cp -pr ../../youtube /vitess/go/vt/proto/query dependency/querypb
116+ cp -pr ../../vitessio /vitess/go/vt/proto/query dependency/querypb
115117sed -i ' .bak' ' s_.*Descriptor.*__g' dependency/querypb/* .go
116118sed -i ' .bak' ' s_.*ProtoMessage.*__g' dependency/querypb/* .go
117119
@@ -135,8 +137,8 @@ go test ./...
135137
136138# Finally make some diffs (for later reference)
137139cd $GOPATH /src/github.com
138- diff -u youtube /vitess/go/sqltypes/ xwb1989/sqlparser/dependency/sqltypes/ > xwb1989/sqlparser/patches/sqltypes.patch
139- diff -u youtube /vitess/go/bytes2/ xwb1989/sqlparser/dependency/bytes2/ > xwb1989/sqlparser/patches/bytes2.patch
140- diff -u youtube /vitess/go/vt/proto/query/ xwb1989/sqlparser/dependency/querypb/ > xwb1989/sqlparser/patches/querypb.patch
141- diff -u youtube /vitess/go/vt/sqlparser/ xwb1989/sqlparser/ > xwb1989/sqlparser/patches/sqlparser.patch
140+ diff -u vitessio /vitess/go/sqltypes/ xwb1989/sqlparser/dependency/sqltypes/ > xwb1989/sqlparser/patches/sqltypes.patch
141+ diff -u vitessio /vitess/go/bytes2/ xwb1989/sqlparser/dependency/bytes2/ > xwb1989/sqlparser/patches/bytes2.patch
142+ diff -u vitessio /vitess/go/vt/proto/query/ xwb1989/sqlparser/dependency/querypb/ > xwb1989/sqlparser/patches/querypb.patch
143+ diff -u vitessio /vitess/go/vt/sqlparser/ xwb1989/sqlparser/ > xwb1989/sqlparser/patches/sqlparser.patch
142144```
0 commit comments