@@ -4,10 +4,10 @@ Go package for parsing MySQL SQL queries.
4
4
5
5
## Notice
6
6
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 ) .
8
8
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.
11
11
12
12
## Usage
13
13
@@ -54,13 +54,13 @@ See [parse_test.go](https://github.com/xwb1989/sqlparser/blob/master/parse_test.
54
54
55
55
## Porting Instructions
56
56
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 ) .
58
58
59
59
### Keeping up to date
60
60
61
61
``` bash
62
62
shopt -s nullglob
63
- VITESS=${GOPATH?} /src/github.com/youtube /vitess/go/
63
+ VITESS=${GOPATH?} /src/github.com/vitessio /vitess/go/
64
64
XWB1989=${GOPATH?} /src/github.com/xwb1989/sqlparser/
65
65
66
66
# Create patches for everything that changed
@@ -92,26 +92,28 @@ rm ${VITESS?}/{sqltypes,bytes2,hack}/*.patch ${VITESS?}/*.patch
92
92
93
93
### Fresh install
94
94
95
+ TODO: Change these instructions to use git to copy the files, that'll make later patching easier.
96
+
95
97
``` bash
96
98
cd $GOPATH /src/github.com/xwb1989/sqlparser
97
99
98
100
# 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
103
105
104
106
# Delete some code we haven't ported
105
107
rm 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
106
108
107
109
# Some automated fixes
108
110
109
111
# 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
112
114
113
115
# 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
115
117
sed -i ' .bak' ' s_.*Descriptor.*__g' dependency/querypb/* .go
116
118
sed -i ' .bak' ' s_.*ProtoMessage.*__g' dependency/querypb/* .go
117
119
@@ -135,8 +137,8 @@ go test ./...
135
137
136
138
# Finally make some diffs (for later reference)
137
139
cd $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
142
144
```
0 commit comments