-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ALTER INDEX statement (#76)
Co-authored-by: Hiroya Fujinami <[email protected]>
- Loading branch information
1 parent
8de04c5
commit 9bdd6e4
Showing
11 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter index foo add stored column bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter index foo drop stored column bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- alter_index_add_stored_column.sql | ||
alter index foo add stored column bar | ||
|
||
--- AST | ||
&ast.AlterIndex{ | ||
Alter: 0, | ||
Name: &ast.Ident{ | ||
NamePos: 12, | ||
NameEnd: 15, | ||
Name: "foo", | ||
}, | ||
IndexAlternation: &ast.AddStoredColumn{ | ||
Add: 16, | ||
Name: &ast.Ident{ | ||
NamePos: 34, | ||
NameEnd: 37, | ||
Name: "bar", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
ALTER INDEX foo ADD STORED COLUMN bar |
23 changes: 23 additions & 0 deletions
23
testdata/result/ddl/alter_index_drop_stored_column.sql.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- alter_index_drop_stored_column.sql | ||
alter index foo drop stored column bar | ||
|
||
--- AST | ||
&ast.AlterIndex{ | ||
Alter: 0, | ||
Name: &ast.Ident{ | ||
NamePos: 12, | ||
NameEnd: 15, | ||
Name: "foo", | ||
}, | ||
IndexAlternation: &ast.DropStoredColumn{ | ||
Drop: 16, | ||
Name: &ast.Ident{ | ||
NamePos: 35, | ||
NameEnd: 38, | ||
Name: "bar", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
ALTER INDEX foo DROP STORED COLUMN bar |
23 changes: 23 additions & 0 deletions
23
testdata/result/statement/alter_index_add_stored_column.sql.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- alter_index_add_stored_column.sql | ||
alter index foo add stored column bar | ||
|
||
--- AST | ||
&ast.AlterIndex{ | ||
Alter: 0, | ||
Name: &ast.Ident{ | ||
NamePos: 12, | ||
NameEnd: 15, | ||
Name: "foo", | ||
}, | ||
IndexAlternation: &ast.AddStoredColumn{ | ||
Add: 16, | ||
Name: &ast.Ident{ | ||
NamePos: 34, | ||
NameEnd: 37, | ||
Name: "bar", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
ALTER INDEX foo ADD STORED COLUMN bar |
23 changes: 23 additions & 0 deletions
23
testdata/result/statement/alter_index_drop_stored_column.sql.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- alter_index_drop_stored_column.sql | ||
alter index foo drop stored column bar | ||
|
||
--- AST | ||
&ast.AlterIndex{ | ||
Alter: 0, | ||
Name: &ast.Ident{ | ||
NamePos: 12, | ||
NameEnd: 15, | ||
Name: "foo", | ||
}, | ||
IndexAlternation: &ast.DropStoredColumn{ | ||
Drop: 16, | ||
Name: &ast.Ident{ | ||
NamePos: 35, | ||
NameEnd: 38, | ||
Name: "bar", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
ALTER INDEX foo DROP STORED COLUMN bar |