DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
155 stars 52 forks source link

Feature request: `RENAME TABLE tbl_old TO tbl_new` #151

Closed LeoniePhiline closed 1 year ago

LeoniePhiline commented 1 year ago
RENAME TABLE `tbl_old` TO `tbl_new`;

Documentation

https://mariadb.com/kb/en/rename-table/

Error

grafik

Syntax

RENAME TABLE[S] [IF EXISTS] tbl_name 
  [WAIT n | NOWAIT]
  TO new_tbl_name
    [, tbl_name2 TO new_tbl_name2] ...

Adjustments

New $._rename_statement, or directly $.rename_table at: https://github.com/DerekStride/tree-sitter-sql/blob/main/grammar.js#L484-L488

Definition of rename_table, similar to, but simpler than alter_table.

LeoniePhiline commented 1 year ago

Wow, thanks @matthias-Q !