Skip to content

Commit f1bf51f

Browse files
upgrade to 0.55.0
1 parent 10c855a commit f1bf51f

File tree

8 files changed

+60
-50
lines changed

8 files changed

+60
-50
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bigdecimal-sql = ["bigdecimal", "df_sqlparser/bigdecimal"]
4343

4444
[dependencies]
4545
bigdecimal = { version = "0.4.1", features = ["serde"], optional = true }
46-
df_sqlparser = { package = "sqlparser", version = "0.54.0" }
46+
df_sqlparser = { package = "sqlparser", version = "0.55.0" }
4747
log = "0.4"
4848
recursive = { version = "0.1.1", optional = true}
4949

src/ast/data_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ impl fmt::Display for CharLengthUnits {
912912
}
913913
}
914914

915-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
915+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
916916
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
917917
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
918918
pub enum BinaryLength {
@@ -960,7 +960,7 @@ pub enum ArrayElemTypeDef {
960960
/// PostgreSQL/Redshift for spatial operations and geometry-related computations.
961961
///
962962
/// [Postgres]: https://www.postgresql.org/docs/9.5/functions-geometry.html
963-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
963+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, DFConvert)]
964964
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
965965
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
966966
pub enum GeometricTypeKind {

src/ast/ddl.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ impl fmt::Display for AlterIndexOperation {
698698
}
699699

700700
/// An `ALTER TYPE` statement (`Statement::AlterType`)
701-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
701+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
702702
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
703703
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
704704
pub struct AlterType {
@@ -707,7 +707,7 @@ pub struct AlterType {
707707
}
708708

709709
/// An [AlterType] operation
710-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
710+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
711711
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
712712
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
713713
pub enum AlterTypeOperation {
@@ -717,15 +717,15 @@ pub enum AlterTypeOperation {
717717
}
718718

719719
/// See [AlterTypeOperation::Rename]
720-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
720+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
721721
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
722722
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
723723
pub struct AlterTypeRename {
724724
pub new_name: Ident,
725725
}
726726

727727
/// See [AlterTypeOperation::AddValue]
728-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
728+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
729729
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730730
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
731731
pub struct AlterTypeAddValue {
@@ -735,7 +735,7 @@ pub struct AlterTypeAddValue {
735735
}
736736

737737
/// See [AlterTypeAddValue]
738-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
738+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
739739
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
740740
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
741741
pub enum AlterTypeAddValuePosition {
@@ -744,7 +744,7 @@ pub enum AlterTypeAddValuePosition {
744744
}
745745

746746
/// See [AlterTypeOperation::RenameValue]
747-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
747+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
748748
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
749749
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
750750
pub struct AlterTypeRenameValue {
@@ -2226,7 +2226,7 @@ impl fmt::Display for CreateFunction {
22262226
/// ```
22272227
///
22282228
/// [Hive](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362034#LanguageManualDDL-CreateDataConnectorCreateConnector)
2229-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
2229+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
22302230
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22312231
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
22322232
pub struct CreateConnector {

src/ast/helpers/key_value_options.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,21 @@ use core::fmt::Formatter;
2828
#[cfg(feature = "serde")]
2929
use serde::{Deserialize, Serialize};
3030

31+
use crate::ast::Convert;
32+
use sqlparser_derive::DFConvert;
3133
#[cfg(feature = "visitor")]
3234
use sqlparser_derive::{Visit, VisitMut};
3335

34-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
36+
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, DFConvert)]
37+
#[df_path(df_sqlparser::ast::helpers::key_value_options)]
3538
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3639
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
3740
pub struct KeyValueOptions {
3841
pub options: Vec<KeyValueOption>,
3942
}
4043

41-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
44+
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, DFConvert)]
45+
#[df_path(df_sqlparser::ast::helpers::key_value_options)]
4246
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4347
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
4448
pub enum KeyValueOptionType {
@@ -48,7 +52,8 @@ pub enum KeyValueOptionType {
4852
NUMBER,
4953
}
5054

51-
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
55+
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, DFConvert)]
56+
#[df_path(df_sqlparser::ast::helpers::key_value_options)]
5257
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5358
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
5459
pub struct KeyValueOption {

src/ast/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl fmt::Display for ObjectName {
328328
}
329329

330330
/// A single part of an ObjectName
331-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
331+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
332332
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
333333
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
334334
pub enum ObjectNamePart {
@@ -644,7 +644,7 @@ pub enum CeilFloorKind {
644644

645645
/// A WHEN clause in a CASE expression containing both
646646
/// the condition and its corresponding result
647-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
647+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
648648
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
649649
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
650650
pub struct CaseWhen {
@@ -5904,7 +5904,7 @@ impl fmt::Display for Action {
59045904
}
59055905
}
59065906

5907-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
5907+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
59085908
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59095909
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
59105910
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -5951,7 +5951,7 @@ impl fmt::Display for ActionCreateObjectType {
59515951
}
59525952
}
59535953

5954-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
5954+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
59555955
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59565956
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
59575957
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -5986,7 +5986,7 @@ impl fmt::Display for ActionApplyType {
59865986
}
59875987
}
59885988

5989-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
5989+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
59905990
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59915991
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
59925992
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -6011,7 +6011,7 @@ impl fmt::Display for ActionExecuteObjectType {
60116011
}
60126012
}
60136013

6014-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
6014+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
60156015
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
60166016
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
60176017
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -6040,7 +6040,7 @@ impl fmt::Display for ActionManageType {
60406040
}
60416041
}
60426042

6043-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
6043+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
60446044
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
60456045
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
60466046
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -6063,7 +6063,7 @@ impl fmt::Display for ActionModifyType {
60636063
}
60646064
}
60656065

6066-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
6066+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
60676067
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
60686068
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
60696069
/// See <https://docs.snowflake.com/en/sql-reference/sql/grant-privilege>
@@ -8571,7 +8571,7 @@ impl fmt::Display for ShowStatementIn {
85718571
}
85728572
}
85738573

8574-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
8574+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
85758575
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
85768576
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
85778577
pub struct ShowObjects {
@@ -8777,7 +8777,7 @@ impl fmt::Display for SessionParamValue {
87778777
/// ```
87788778
///
87798779
/// <https://docs.snowflake.com/en/sql-reference/sql/create-iceberg-table>
8780-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
8780+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
87818781
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
87828782
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
87838783
pub enum StorageSerializationPolicy {
@@ -8795,7 +8795,7 @@ impl Display for StorageSerializationPolicy {
87958795
}
87968796

87978797
/// Variants of the Snowflake `COPY INTO` statement
8798-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
8798+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
87998799
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
88008800
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
88018801
pub enum CopyIntoSnowflakeKind {

src/ast/query.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl fmt::Display for Table {
276276
}
277277

278278
/// What did this select look like?
279-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
279+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
280280
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
281281
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
282282
pub enum SelectFlavor {
@@ -613,7 +613,7 @@ impl fmt::Display for Cte {
613613

614614
/// Represents an expression behind a wildcard expansion in a projection.
615615
/// `SELECT T.* FROM T;
616-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
616+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
617617
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
618618
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
619619
pub enum SelectItemQualifiedWildcardKind {
@@ -1026,7 +1026,7 @@ pub struct TableFunctionArgs {
10261026
pub settings: Option<Vec<Setting>>,
10271027
}
10281028

1029-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1029+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
10301030
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10311031
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10321032
pub enum TableIndexHintType {
@@ -1045,7 +1045,7 @@ impl fmt::Display for TableIndexHintType {
10451045
}
10461046
}
10471047

1048-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1048+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
10491049
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10501050
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10511051
pub enum TableIndexType {
@@ -1062,7 +1062,7 @@ impl fmt::Display for TableIndexType {
10621062
}
10631063
}
10641064

1065-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1065+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
10661066
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10671067
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10681068
pub enum TableIndexHintForClause {
@@ -1081,7 +1081,7 @@ impl fmt::Display for TableIndexHintForClause {
10811081
}
10821082
}
10831083

1084-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
1084+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
10851085
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10861086
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10871087
pub struct TableIndexHints {

src/ast/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use crate::ast::DFConvert;
7272
/// // convert back to `Value`
7373
/// let value: Value = value_with_span.into();
7474
/// ```
75-
#[derive(Debug, Clone, Eq)]
75+
#[derive(Debug, Clone, Eq, DFConvert)]
7676
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7777
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
7878
pub struct ValueWithSpan {

0 commit comments

Comments
 (0)