Skip to content

Commit 90ab7ef

Browse files
authored
Merge pull request #12 from sjjian/support_drop_table
support parser "drop table"
2 parents 7a9c541 + a24f355 commit 90ab7ef

File tree

6 files changed

+3248
-2955
lines changed

6 files changed

+3248
-2955
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ this is an oracle sql parser. ref: https://docs.oracle.com/en/database/oracle/or
1414
|Alter table|Drop constraint| :heavy_check_mark:| |
1515
|Create table|Relational table|:heavy_check_mark:|:heavy_check_mark:|
1616
|Create index|Relational table|:heavy_check_mark:| |
17+
|Drop table|-|:heavy_check_mark:|:heavy_check_mark:|
18+
1719
## usage
1820
```go
1921
package main

ast/ddl.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,19 @@ type OutOfLineConstraint struct {
108108
}
109109

110110
/*
111-
Create Table Statement
111+
Create Index Statement
112112
see: https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/CREATE-INDEX.html#GUID-1F89BBC0-825F-4215-AF71-7588E31D8BFE
113113
*/
114114

115115
type CreateIndexStmt struct {
116116
node
117117
}
118+
119+
/*
120+
Drop Table Statement
121+
see: https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/CREATE-INDEX.html#GUID-1F89BBC0-825F-4215-AF71-7588E31D8BFE
122+
*/
123+
type DropTableStmt struct {
124+
node
125+
TableName *TableName
126+
}

lexer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ var keywordMap = map[string]int{
301301
"usable": _usable,
302302
"unusable": _unusable,
303303
"invalidation": _invalidation,
304+
"purge": _purge,
304305
}
305306

306307
func init() {

0 commit comments

Comments
 (0)