Skip to content

Commit

Permalink
sql-statements: use ENBF to render syntax diagrams for BACKUP and RES…
Browse files Browse the repository at this point in the history
…TORE
  • Loading branch information
kennytm committed Dec 4, 2020
1 parent 83d3bfd commit 39a6e89
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 40 deletions.
Binary file removed media/sqlgram/BRIETables.png
Binary file not shown.
Binary file removed media/sqlgram/BackupOption.png
Binary file not shown.
Binary file removed media/sqlgram/BackupStmt.png
Binary file not shown.
Binary file removed media/sqlgram/BackupTSO.png
Binary file not shown.
Binary file removed media/sqlgram/Boolean.png
Binary file not shown.
Binary file removed media/sqlgram/RestoreOption.png
Binary file not shown.
Binary file removed media/sqlgram/RestoreStmt.png
Binary file not shown.
Binary file removed media/sqlgram/ShowBRIEStmt.png
Binary file not shown.
41 changes: 22 additions & 19 deletions sql-statements/sql-statement-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,28 @@ Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task

## Synopsis

**BackupStmt:**

![BackupStmt](/media/sqlgram/BackupStmt.png)

**BRIETables:**

![BRIETables](/media/sqlgram/BRIETables.png)

**BackupOption:**

![BackupOption](/media/sqlgram/BackupOption.png)

**Boolean:**

![Boolean](/media/sqlgram/Boolean.png)

**BackupTSO:**

![BackupTSO](/media/sqlgram/BackupTSO.png)
```ebnf+diagram
BackupStmt ::=
"BACKUP" BRIETables "TO" stringLit BackupOption*
BRIETables ::=
"DATABASE" ( '*' | DBName (',' DBName)* )
| "TABLE" TableNameList
BackupOption ::=
"RATE_LIMIT" '='? LengthNum "MB" '/' "SECOND"
| "CONCURRENCY" '='? LengthNum
| "CHECKSUM" '='? Boolean
| "SEND_CREDENTIALS_TO_TIKV" '='? Boolean
| "LAST_BACKUP" '='? BackupTSO
| "SNAPSHOT" '='? ( BackupTSO | LengthNum TimestampUnit "AGO" )
Boolean ::=
NUM | "TRUE" | "FALSE"
BackupTSO ::=
LengthNum | stringLit
```

## Examples

Expand Down
32 changes: 17 additions & 15 deletions sql-statements/sql-statement-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@ Only one `BACKUP` and `RESTORE` task can be executed at a time. If a `BACKUP` or

## Synopsis

**RestoreStmt:**

![RestoreStmt](/media/sqlgram/RestoreStmt.png)

**BRIETables:**

![BRIETables](/media/sqlgram/BRIETables.png)

**RestoreOption:**

![RestoreOption](/media/sqlgram/RestoreOption.png)

**Boolean:**

![Boolean](/media/sqlgram/Boolean.png)
```ebnf+diagram
RestoreStmt ::=
"RESTORE" BRIETables "FROM" stringLit RestoreOption*
BRIETables ::=
"DATABASE" ( '*' | DBName (',' DBName)* )
| "TABLE" TableNameList
BackupOption ::=
"RATE_LIMIT" '='? LengthNum "MB" '/' "SECOND"
| "CONCURRENCY" '='? LengthNum
| "CHECKSUM" '='? Boolean
| "SEND_CREDENTIALS_TO_TIKV" '='? Boolean
Boolean ::=
NUM | "TRUE" | "FALSE"
```

## Examples

Expand Down
13 changes: 7 additions & 6 deletions sql-statements/sql-statement-show-backups.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RES

## Synopsis

**ShowBRIEStmt:**
```ebnf+diagram
ShowBRIEStmt ::=
"SHOW" ("BACKUPS" | "RESTORES") ShowLikeOrWhere?
![ShowBRIEStmt](/media/sqlgram/ShowBRIEStmt.png)

**ShowLikeOrWhereOpt:**

![ShowLikeOrWhereOpt](/media/sqlgram/ShowLikeOrWhereOpt.png)
ShowLikeOrWhere ::=
"LIKE" SimpleExpr
| "WHERE" Expression
```

## Examples

Expand Down

0 comments on commit 39a6e89

Please sign in to comment.