@@ -3455,6 +3455,10 @@ pub enum Statement {
3455
3455
/// Snowflake `REMOVE`
3456
3456
/// See: <https://docs.snowflake.com/en/sql-reference/sql/remove>
3457
3457
Remove ( FileStagingCommand ) ,
3458
+ /// MS-SQL session
3459
+ ///
3460
+ /// See <https://learn.microsoft.com/en-us/sql/t-sql/statements/set-statements-transact-sql>
3461
+ SetSessionParam ( SetSessionParamKind ) ,
3458
3462
}
3459
3463
3460
3464
impl fmt:: Display for Statement {
@@ -5042,6 +5046,7 @@ impl fmt::Display for Statement {
5042
5046
}
5043
5047
Statement :: List ( command) => write ! ( f, "LIST {command}" ) ,
5044
5048
Statement :: Remove ( command) => write ! ( f, "REMOVE {command}" ) ,
5049
+ Statement :: SetSessionParam ( kind) => write ! ( f, "SET {kind}" ) ,
5045
5050
}
5046
5051
}
5047
5052
}
@@ -6459,6 +6464,7 @@ pub enum TransactionIsolationLevel {
6459
6464
ReadCommitted ,
6460
6465
RepeatableRead ,
6461
6466
Serializable ,
6467
+ Snapshot ,
6462
6468
}
6463
6469
6464
6470
impl fmt:: Display for TransactionIsolationLevel {
@@ -6469,6 +6475,7 @@ impl fmt::Display for TransactionIsolationLevel {
6469
6475
ReadCommitted => "READ COMMITTED" ,
6470
6476
RepeatableRead => "REPEATABLE READ" ,
6471
6477
Serializable => "SERIALIZABLE" ,
6478
+ Snapshot => "SNAPSHOT" ,
6472
6479
} )
6473
6480
}
6474
6481
}
@@ -7955,6 +7962,126 @@ impl fmt::Display for TableObject {
7955
7962
}
7956
7963
}
7957
7964
7965
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
7966
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
7967
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
7968
+ pub enum SetSessionParamKind {
7969
+ Generic ( SetSessionParamGeneric ) ,
7970
+ IdentityInsert ( SetSessionParamIdentityInsert ) ,
7971
+ Offsets ( SetSessionParamOffsets ) ,
7972
+ Statistics ( SetSessionParamStatistics ) ,
7973
+ }
7974
+
7975
+ impl fmt:: Display for SetSessionParamKind {
7976
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
7977
+ match self {
7978
+ SetSessionParamKind :: Generic ( x) => write ! ( f, "{x}" ) ,
7979
+ SetSessionParamKind :: IdentityInsert ( x) => write ! ( f, "{x}" ) ,
7980
+ SetSessionParamKind :: Offsets ( x) => write ! ( f, "{x}" ) ,
7981
+ SetSessionParamKind :: Statistics ( x) => write ! ( f, "{x}" ) ,
7982
+ }
7983
+ }
7984
+ }
7985
+
7986
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
7987
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
7988
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
7989
+ pub struct SetSessionParamGeneric {
7990
+ pub names : Vec < String > ,
7991
+ pub value : String ,
7992
+ }
7993
+
7994
+ impl fmt:: Display for SetSessionParamGeneric {
7995
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
7996
+ write ! ( f, "{} {}" , display_comma_separated( & self . names) , self . value)
7997
+ }
7998
+ }
7999
+
8000
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
8001
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
8002
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
8003
+ pub struct SetSessionParamIdentityInsert {
8004
+ pub obj : ObjectName ,
8005
+ pub value : SessionParamValue ,
8006
+ }
8007
+
8008
+ impl fmt:: Display for SetSessionParamIdentityInsert {
8009
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
8010
+ write ! ( f, "IDENTITY_INSERT {} {}" , self . obj, self . value)
8011
+ }
8012
+ }
8013
+
8014
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
8015
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
8016
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
8017
+ pub struct SetSessionParamOffsets {
8018
+ pub keywords : Vec < String > ,
8019
+ pub value : SessionParamValue ,
8020
+ }
8021
+
8022
+ impl fmt:: Display for SetSessionParamOffsets {
8023
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
8024
+ write ! (
8025
+ f,
8026
+ "OFFSETS {} {}" ,
8027
+ display_comma_separated( & self . keywords) ,
8028
+ self . value
8029
+ )
8030
+ }
8031
+ }
8032
+
8033
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
8034
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
8035
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
8036
+ pub struct SetSessionParamStatistics {
8037
+ pub topic : SessionParamStatsTopic ,
8038
+ pub value : SessionParamValue ,
8039
+ }
8040
+
8041
+ impl fmt:: Display for SetSessionParamStatistics {
8042
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
8043
+ write ! ( f, "STATISTICS {} {}" , self . topic, self . value)
8044
+ }
8045
+ }
8046
+
8047
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
8048
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
8049
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
8050
+ pub enum SessionParamStatsTopic {
8051
+ IO ,
8052
+ Profile ,
8053
+ Time ,
8054
+ Xml ,
8055
+ }
8056
+
8057
+ impl fmt:: Display for SessionParamStatsTopic {
8058
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
8059
+ match self {
8060
+ SessionParamStatsTopic :: IO => write ! ( f, "IO" ) ,
8061
+ SessionParamStatsTopic :: Profile => write ! ( f, "PROFILE" ) ,
8062
+ SessionParamStatsTopic :: Time => write ! ( f, "TIME" ) ,
8063
+ SessionParamStatsTopic :: Xml => write ! ( f, "XML" ) ,
8064
+ }
8065
+ }
8066
+ }
8067
+
8068
+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
8069
+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
8070
+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
8071
+ pub enum SessionParamValue {
8072
+ On ,
8073
+ Off ,
8074
+ }
8075
+
8076
+ impl fmt:: Display for SessionParamValue {
8077
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
8078
+ match self {
8079
+ SessionParamValue :: On => write ! ( f, "ON" ) ,
8080
+ SessionParamValue :: Off => write ! ( f, "OFF" ) ,
8081
+ }
8082
+ }
8083
+ }
8084
+
7958
8085
#[ cfg( test) ]
7959
8086
mod tests {
7960
8087
use super :: * ;
0 commit comments