Skip to content

Commit c8e84be

Browse files
authored
Break out ast.go into multiple files (#506)
* sql/ast: Export ast.go into individual files * Fix package name and go fmt * Use correct build tags for compiler
1 parent f94a933 commit c8e84be

37 files changed

+360
-323
lines changed

internal/compiler/engine.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build exp
2+
13
package compiler
24

35
import (

internal/compiler/runtime/parse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build exp
2+
13
package runtime
24

35
import (

internal/sql/ast/alter_table_cmd.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package ast
2+
3+
type AlterTableType int
4+
5+
const (
6+
AT_AddColumn AlterTableType = iota
7+
AT_AlterColumnType
8+
AT_DropColumn
9+
AT_DropNotNull
10+
AT_SetNotNull
11+
)
12+
13+
type AlterTableCmd struct {
14+
Subtype AlterTableType
15+
Name *string
16+
Def *ColumnDef
17+
MissingOk bool
18+
}
19+
20+
func (n *AlterTableCmd) Pos() int {
21+
return 0
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ast
2+
3+
type AlterTableSetSchemaStmt struct {
4+
Table *TableName
5+
NewSchema *string
6+
}
7+
8+
func (n *AlterTableSetSchemaStmt) Pos() int {
9+
return 0
10+
}

internal/sql/ast/alter_table_stmt.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package ast
2+
3+
type AlterTableStmt struct {
4+
Table *TableName
5+
Cmds *List
6+
// MissingOk bool
7+
}
8+
9+
func (n *AlterTableStmt) Pos() int {
10+
return 0
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package ast
2+
3+
type AlterTypeAddValueStmt struct {
4+
Type *TypeName
5+
NewValue *string
6+
SkipIfNewValExists bool
7+
}
8+
9+
func (n *AlterTypeAddValueStmt) Pos() int {
10+
return 0
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package ast
2+
3+
type AlterTypeRenameValueStmt struct {
4+
Type *TypeName
5+
OldValue *string
6+
NewValue *string
7+
}
8+
9+
func (n *AlterTypeRenameValueStmt) Pos() int {
10+
return 0
11+
}

0 commit comments

Comments
 (0)