Skip to content

Commit 558ae93

Browse files
upgrade to 0.58.0, and remove the "convert"
1 parent 2b33ceb commit 558ae93

File tree

18 files changed

+250
-344
lines changed

18 files changed

+250
-344
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ recursive-protection = ["std", "recursive"]
3939
# Enable JSON output in the `cli` example:
4040
json_example = ["serde_json", "serde"]
4141
visitor = ["sqlparser_derive"]
42-
bigdecimal-sql = ["bigdecimal", "df_sqlparser/bigdecimal"]
4342

4443
[dependencies]
4544
bigdecimal = { version = "0.4.1", features = ["serde"], optional = true }
46-
df_sqlparser = { package = "sqlparser", version = "0.55.0" }
4745
log = "0.4"
4846
recursive = { version = "0.1.1", optional = true}
4947

src/ast/data_type.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ use crate::ast::{display_comma_separated, Expr, ObjectName, StructField, UnionFi
2929

3030
use super::{value::escape_single_quote_string, ColumnDef};
3131

32-
use crate::ast::Convert;
33-
use crate::ast::DFConvert;
34-
35-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
32+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
3633
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3734
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
3835
pub enum EnumMember {
@@ -44,7 +41,7 @@ pub enum EnumMember {
4441
}
4542

4643
/// SQL data types
47-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
44+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
4845
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4946
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
5047
pub enum DataType {
@@ -893,7 +890,7 @@ fn format_clickhouse_datetime_precision_and_timezone(
893890
}
894891

895892
/// Type of brackets used for `STRUCT` literals.
896-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
893+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
897894
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
898895
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
899896
pub enum StructBracketKind {
@@ -907,7 +904,7 @@ pub enum StructBracketKind {
907904
///
908905
/// This is more related to a display information than real differences between each variant. To
909906
/// guarantee compatibility with the input query we must maintain its exact information.
910-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
907+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
911908
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
912909
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
913910
pub enum TimezoneInfo {
@@ -1028,7 +1025,7 @@ impl fmt::Display for ExactNumberInfo {
10281025
/// Information about [character length][1], including length and possibly unit.
10291026
///
10301027
/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-length
1031-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
1028+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
10321029
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10331030
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10341031
pub enum CharacterLength {
@@ -1062,7 +1059,7 @@ impl fmt::Display for CharacterLength {
10621059
/// Possible units for characters, initially based on 2016 ANSI [SQL Standard][1].
10631060
///
10641061
/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#char-length-units
1065-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
1062+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
10661063
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10671064
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10681065
pub enum CharLengthUnits {
@@ -1085,7 +1082,7 @@ impl fmt::Display for CharLengthUnits {
10851082
}
10861083
}
10871084

1088-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
1085+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
10891086
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10901087
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
10911088
pub enum BinaryLength {
@@ -1115,7 +1112,7 @@ impl fmt::Display for BinaryLength {
11151112
/// the syntax used to declare the array.
11161113
///
11171114
/// For example: Bigquery/Hive use `ARRAY<INT>` whereas snowflake uses ARRAY.
1118-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
1115+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
11191116
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11201117
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
11211118
pub enum ArrayElemTypeDef {

src/ast/dcl.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
//! AST types specific to GRANT/REVOKE/ROLE variants of [`Statement`](crate::ast::Statement)
1919
//! (commonly referred to as Data Control Language, or DCL)
2020
21-
use crate::ast::Convert;
2221
#[cfg(not(feature = "std"))]
2322
use alloc::vec::Vec;
2423
use core::fmt;
25-
use sqlparser_derive::DFConvert;
2624

2725
#[cfg(feature = "serde")]
2826
use serde::{Deserialize, Serialize};
@@ -36,7 +34,7 @@ use crate::ast::{display_separated, ObjectName};
3634
/// An option in `ROLE` statement.
3735
///
3836
/// <https://www.postgresql.org/docs/current/sql-createrole.html>
39-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
37+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
4038
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4139
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
4240
pub enum RoleOption {
@@ -101,7 +99,7 @@ impl fmt::Display for RoleOption {
10199
/// SET config value option:
102100
/// * SET `configuration_parameter` { TO | = } { `value` | DEFAULT }
103101
/// * SET `configuration_parameter` FROM CURRENT
104-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
102+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
105103
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
106104
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
107105
pub enum SetConfigValue {
@@ -113,7 +111,7 @@ pub enum SetConfigValue {
113111
/// RESET config option:
114112
/// * RESET `configuration_parameter`
115113
/// * RESET ALL
116-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
114+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
117115
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
118116
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
119117
pub enum ResetConfig {
@@ -122,7 +120,7 @@ pub enum ResetConfig {
122120
}
123121

124122
/// An `ALTER ROLE` (`Statement::AlterRole`) operation
125-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
123+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
126124
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
127125
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
128126
pub enum AlterRoleOperation {
@@ -202,7 +200,7 @@ impl fmt::Display for AlterRoleOperation {
202200
}
203201

204202
/// A `USE` (`Statement::Use`) operation
205-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
203+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
206204
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207205
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
208206
pub enum Use {
@@ -236,7 +234,7 @@ impl fmt::Display for Use {
236234

237235
/// Snowflake `SECONDARY ROLES` USE variant
238236
/// See: <https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles>
239-
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash, DFConvert)]
237+
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
240238
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
241239
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
242240
pub enum SecondaryRoles {

0 commit comments

Comments
 (0)