Skip to content

Commit

Permalink
support Show Sharding table from xxx (arana-db#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengchuang123 authored Mar 20, 2023
1 parent 7dcfe22 commit e410dbf
Show file tree
Hide file tree
Showing 5 changed files with 9,048 additions and 9,013 deletions.
4 changes: 4 additions & 0 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,7 @@ const (
ShowTableRules
ShowUsers
ShowDatabaseRules
ShowShardingTable
)

const (
Expand Down Expand Up @@ -2735,6 +2736,9 @@ func (n *ShowStmt) Restore(ctx *format.RestoreCtx) error {
case ShowDatabaseRules:
ctx.WriteKeyWord("DATABASE RULES FROM ")
ctx.WriteName(n.DBName)
case ShowShardingTable:
ctx.WriteKeyWord("SHARDING TABLE FROM ")
ctx.WriteName(n.DBName)
case ShowCreateDatabase:
ctx.WriteKeyWord("CREATE DATABASE ")
if n.IfNotExists {
Expand Down
1 change: 1 addition & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ var tokenMap = map[string]int{
"SHARD_ROW_ID_BITS": shardRowIDBits,
"SHARE": share,
"SHARED": shared,
"SHARDING": sharding,
"SHOW": show,
"SHUTDOWN": shutdown,
"SIGNED": signed,
Expand Down
Loading

0 comments on commit e410dbf

Please sign in to comment.