Skip to content

Commit cd3a8cc

Browse files
Merge pull request #12 from stackql/feature/insert-returning-v1
insert-returning
2 parents c31991c + d5cd78d commit cd3a8cc

File tree

7 files changed

+3635
-3482
lines changed

7 files changed

+3635
-3482
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ There are elements of the original work that are not required, but may take some
1010
## Rebuilding parser
1111

1212

13-
```
13+
```bash
1414
make -C go/vt/sqlparser
1515
```
1616

1717

1818
After changes to the ast:
1919

20-
```
21-
cd go/vt/sqlparser
22-
23-
go run ./visitorgen/main -input=ast.go -output=rewriter.go
20+
```bash
21+
cicd/build_scripts/01_ast_rebuild.sh
2422
```
2523

2624

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
CURDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4+
5+
REPOSITORY_ROOT="$(realpath "${CURDIR}/../..")"
6+
7+
cd "${REPOSITORY_ROOT}/go/vt/sqlparser"
8+
9+
go run ./visitorgen/main -input=ast.go -output=rewriter.go

go/vt/sqlparser/ast.go

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -131,40 +131,43 @@ type (
131131
// of the implications the deletion part may have on vindexes.
132132
// If you add fields here, consider adding them to calls to validateUnshardedRoute.
133133
Insert struct {
134-
Action string
135-
Comments Comments
136-
Ignore string
137-
Table TableName
138-
Partitions Partitions
139-
Columns Columns
140-
Rows InsertRows
141-
OnDup OnDup
134+
Action string
135+
Comments Comments
136+
Ignore string
137+
Table TableName
138+
Partitions Partitions
139+
Columns Columns
140+
Rows InsertRows
141+
OnDup OnDup
142+
SelectExprs SelectExprs
142143
}
143144

144145
// Update represents an UPDATE statement.
145146
// If you add fields here, consider adding them to calls to validateUnshardedRoute.
146147
Update struct {
147-
Action string
148-
Comments Comments
149-
Ignore string
150-
TableExprs TableExprs
151-
Exprs UpdateExprs
152-
From TableExprs
153-
Where *Where
154-
OrderBy OrderBy
155-
Limit *Limit
148+
Action string
149+
Comments Comments
150+
Ignore string
151+
TableExprs TableExprs
152+
Exprs UpdateExprs
153+
From TableExprs
154+
Where *Where
155+
OrderBy OrderBy
156+
Limit *Limit
157+
SelectExprs SelectExprs
156158
}
157159

158160
// Delete represents a DELETE statement.
159161
// If you add fields here, consider adding them to calls to validateUnshardedRoute.
160162
Delete struct {
161-
Comments Comments
162-
Targets TableNames
163-
TableExprs TableExprs
164-
Partitions Partitions
165-
Where *Where
166-
OrderBy OrderBy
167-
Limit *Limit
163+
Comments Comments
164+
Targets TableNames
165+
TableExprs TableExprs
166+
Partitions Partitions
167+
Where *Where
168+
OrderBy OrderBy
169+
Limit *Limit
170+
SelectExprs SelectExprs
168171
}
169172

170173
// Set represents a SET statement.

go/vt/sqlparser/rewriter.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)