@@ -14,9 +14,10 @@ mod explain;
1414pub mod expr;
1515mod insert;
1616mod select;
17- mod show ;
17+ mod show_table ;
1818mod truncate;
1919mod update;
20+ mod show_view;
2021
2122use sqlparser:: ast:: { Ident , ObjectName , ObjectType , SetExpr , Statement } ;
2223use std:: collections:: { BTreeMap , HashMap , HashSet } ;
@@ -55,7 +56,8 @@ pub fn command_type(stmt: &Statement) -> Result<CommandType, DatabaseError> {
5556 Statement :: Query ( _)
5657 | Statement :: Explain { .. }
5758 | Statement :: ExplainTable { .. }
58- | Statement :: ShowTables { .. } => Ok ( CommandType :: DQL ) ,
59+ | Statement :: ShowTables { .. }
60+ | Statement :: ShowVariable { .. } => Ok ( CommandType :: DQL ) ,
5961 Statement :: Analyze { .. }
6062 | Statement :: Truncate { .. }
6163 | Statement :: Update { .. }
@@ -409,6 +411,13 @@ impl<'a, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'a, '
409411 Statement :: Analyze { table_name, .. } => self . bind_analyze ( table_name) ?,
410412 Statement :: Truncate { table_name, .. } => self . bind_truncate ( table_name) ?,
411413 Statement :: ShowTables { .. } => self . bind_show_tables ( ) ?,
414+ Statement :: ShowVariable { variable } => {
415+ let value = variable[ 0 ] . value . clone ( ) ;
416+ match & value[ ..] {
417+ "views" => self . bind_show_views ( ) ?,
418+ _ => return Err ( DatabaseError :: UnsupportedStmt ( stmt. to_string ( ) ) )
419+ }
420+ } ,
412421 Statement :: Copy {
413422 source,
414423 to,
0 commit comments