@@ -3083,6 +3083,7 @@ fn test_parentheses_overflow() {
3083
3083
#[ test]
3084
3084
fn test_show_databases ( ) {
3085
3085
snowflake ( ) . verified_stmt ( "SHOW DATABASES" ) ;
3086
+ snowflake ( ) . verified_stmt ( "SHOW TERSE DATABASES" ) ;
3086
3087
snowflake ( ) . verified_stmt ( "SHOW DATABASES HISTORY" ) ;
3087
3088
snowflake ( ) . verified_stmt ( "SHOW DATABASES LIKE '%abc%'" ) ;
3088
3089
snowflake ( ) . verified_stmt ( "SHOW DATABASES STARTS WITH 'demo_db'" ) ;
@@ -3095,6 +3096,7 @@ fn test_show_databases() {
3095
3096
#[ test]
3096
3097
fn test_parse_show_schemas ( ) {
3097
3098
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS" ) ;
3099
+ snowflake ( ) . verified_stmt ( "SHOW TERSE SCHEMAS" ) ;
3098
3100
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN ACCOUNT" ) ;
3099
3101
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN ACCOUNT abc" ) ;
3100
3102
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN DATABASE" ) ;
@@ -3104,9 +3106,51 @@ fn test_parse_show_schemas() {
3104
3106
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN DATABASE STARTS WITH 'abc' LIMIT 20 FROM 'xyz'" ) ;
3105
3107
}
3106
3108
3109
+ #[ test]
3110
+ fn test_parse_show_objects ( ) {
3111
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS" ) ;
3112
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN abc" ) ;
3113
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS LIKE '%test%' IN abc" ) ;
3114
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN ACCOUNT" ) ;
3115
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN DATABASE" ) ;
3116
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN DATABASE abc" ) ;
3117
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN SCHEMA" ) ;
3118
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN SCHEMA abc" ) ;
3119
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS" ) ;
3120
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS IN abc" ) ;
3121
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc" ) ;
3122
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b'" ) ;
3123
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b' LIMIT 10" ) ;
3124
+ snowflake ( )
3125
+ . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b' LIMIT 10 FROM 'x'" ) ;
3126
+ match snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc" ) {
3127
+ Statement :: ShowObjects ( ShowObjects {
3128
+ terse,
3129
+ show_options,
3130
+ } ) => {
3131
+ assert ! ( terse) ;
3132
+ let name = match show_options. show_in {
3133
+ Some ( ShowStatementIn {
3134
+ parent_name : Some ( val) ,
3135
+ ..
3136
+ } ) => val. to_string ( ) ,
3137
+ _ => unreachable ! ( ) ,
3138
+ } ;
3139
+ assert_eq ! ( "abc" , name) ;
3140
+ let like = match show_options. filter_position {
3141
+ Some ( ShowStatementFilterPosition :: Infix ( ShowStatementFilter :: Like ( val) ) ) => val,
3142
+ _ => unreachable ! ( ) ,
3143
+ } ;
3144
+ assert_eq ! ( "%test%" , like) ;
3145
+ }
3146
+ _ => unreachable ! ( ) ,
3147
+ }
3148
+ }
3149
+
3107
3150
#[ test]
3108
3151
fn test_parse_show_tables ( ) {
3109
3152
snowflake ( ) . verified_stmt ( "SHOW TABLES" ) ;
3153
+ snowflake ( ) . verified_stmt ( "SHOW TERSE TABLES" ) ;
3110
3154
snowflake ( ) . verified_stmt ( "SHOW TABLES IN ACCOUNT" ) ;
3111
3155
snowflake ( ) . verified_stmt ( "SHOW TABLES IN DATABASE" ) ;
3112
3156
snowflake ( ) . verified_stmt ( "SHOW TABLES IN DATABASE xyz" ) ;
@@ -3129,6 +3173,7 @@ fn test_parse_show_tables() {
3129
3173
#[ test]
3130
3174
fn test_show_views ( ) {
3131
3175
snowflake ( ) . verified_stmt ( "SHOW VIEWS" ) ;
3176
+ snowflake ( ) . verified_stmt ( "SHOW TERSE VIEWS" ) ;
3132
3177
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN ACCOUNT" ) ;
3133
3178
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN DATABASE" ) ;
3134
3179
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN DATABASE xyz" ) ;
0 commit comments