@@ -3090,6 +3090,7 @@ fn test_parentheses_overflow() {
3090
3090
#[ test]
3091
3091
fn test_show_databases ( ) {
3092
3092
snowflake ( ) . verified_stmt ( "SHOW DATABASES" ) ;
3093
+ snowflake ( ) . verified_stmt ( "SHOW TERSE DATABASES" ) ;
3093
3094
snowflake ( ) . verified_stmt ( "SHOW DATABASES HISTORY" ) ;
3094
3095
snowflake ( ) . verified_stmt ( "SHOW DATABASES LIKE '%abc%'" ) ;
3095
3096
snowflake ( ) . verified_stmt ( "SHOW DATABASES STARTS WITH 'demo_db'" ) ;
@@ -3102,6 +3103,7 @@ fn test_show_databases() {
3102
3103
#[ test]
3103
3104
fn test_parse_show_schemas ( ) {
3104
3105
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS" ) ;
3106
+ snowflake ( ) . verified_stmt ( "SHOW TERSE SCHEMAS" ) ;
3105
3107
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN ACCOUNT" ) ;
3106
3108
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN ACCOUNT abc" ) ;
3107
3109
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN DATABASE" ) ;
@@ -3111,9 +3113,51 @@ fn test_parse_show_schemas() {
3111
3113
snowflake ( ) . verified_stmt ( "SHOW SCHEMAS IN DATABASE STARTS WITH 'abc' LIMIT 20 FROM 'xyz'" ) ;
3112
3114
}
3113
3115
3116
+ #[ test]
3117
+ fn test_parse_show_objects ( ) {
3118
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS" ) ;
3119
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN abc" ) ;
3120
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS LIKE '%test%' IN abc" ) ;
3121
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN ACCOUNT" ) ;
3122
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN DATABASE" ) ;
3123
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN DATABASE abc" ) ;
3124
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN SCHEMA" ) ;
3125
+ snowflake ( ) . verified_stmt ( "SHOW OBJECTS IN SCHEMA abc" ) ;
3126
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS" ) ;
3127
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS IN abc" ) ;
3128
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc" ) ;
3129
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b'" ) ;
3130
+ snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b' LIMIT 10" ) ;
3131
+ snowflake ( )
3132
+ . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc STARTS WITH 'b' LIMIT 10 FROM 'x'" ) ;
3133
+ match snowflake ( ) . verified_stmt ( "SHOW TERSE OBJECTS LIKE '%test%' IN abc" ) {
3134
+ Statement :: ShowObjects ( ShowObjects {
3135
+ terse,
3136
+ show_options,
3137
+ } ) => {
3138
+ assert ! ( terse) ;
3139
+ let name = match show_options. show_in {
3140
+ Some ( ShowStatementIn {
3141
+ parent_name : Some ( val) ,
3142
+ ..
3143
+ } ) => val. to_string ( ) ,
3144
+ _ => unreachable ! ( ) ,
3145
+ } ;
3146
+ assert_eq ! ( "abc" , name) ;
3147
+ let like = match show_options. filter_position {
3148
+ Some ( ShowStatementFilterPosition :: Infix ( ShowStatementFilter :: Like ( val) ) ) => val,
3149
+ _ => unreachable ! ( ) ,
3150
+ } ;
3151
+ assert_eq ! ( "%test%" , like) ;
3152
+ }
3153
+ _ => unreachable ! ( ) ,
3154
+ }
3155
+ }
3156
+
3114
3157
#[ test]
3115
3158
fn test_parse_show_tables ( ) {
3116
3159
snowflake ( ) . verified_stmt ( "SHOW TABLES" ) ;
3160
+ snowflake ( ) . verified_stmt ( "SHOW TERSE TABLES" ) ;
3117
3161
snowflake ( ) . verified_stmt ( "SHOW TABLES IN ACCOUNT" ) ;
3118
3162
snowflake ( ) . verified_stmt ( "SHOW TABLES IN DATABASE" ) ;
3119
3163
snowflake ( ) . verified_stmt ( "SHOW TABLES IN DATABASE xyz" ) ;
@@ -3136,6 +3180,7 @@ fn test_parse_show_tables() {
3136
3180
#[ test]
3137
3181
fn test_show_views ( ) {
3138
3182
snowflake ( ) . verified_stmt ( "SHOW VIEWS" ) ;
3183
+ snowflake ( ) . verified_stmt ( "SHOW TERSE VIEWS" ) ;
3139
3184
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN ACCOUNT" ) ;
3140
3185
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN DATABASE" ) ;
3141
3186
snowflake ( ) . verified_stmt ( "SHOW VIEWS IN DATABASE xyz" ) ;
0 commit comments