Skip to main content

sqlparser/ast/
data_type.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#[cfg(not(feature = "std"))]
19use alloc::{boxed::Box, format, string::String, vec::Vec};
20use core::fmt;
21
22#[cfg(feature = "serde")]
23use serde::{Deserialize, Serialize};
24
25#[cfg(feature = "visitor")]
26use sqlparser_derive::{Visit, VisitMut};
27
28use crate::ast::{display_comma_separated, Expr, ObjectName, StructField, UnionField};
29
30use super::{value::escape_single_quote_string, ColumnDef};
31
32#[derive(#[automatically_derived]
impl ::core::fmt::Debug for EnumMember {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            EnumMember::Name(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Name",
                    &__self_0),
            EnumMember::NamedValue(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "NamedValue", __self_0, &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for EnumMember {
    #[inline]
    fn clone(&self) -> EnumMember {
        match self {
            EnumMember::Name(__self_0) =>
                EnumMember::Name(::core::clone::Clone::clone(__self_0)),
            EnumMember::NamedValue(__self_0, __self_1) =>
                EnumMember::NamedValue(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for EnumMember {
    #[inline]
    fn eq(&self, other: &EnumMember) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (EnumMember::Name(__self_0), EnumMember::Name(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (EnumMember::NamedValue(__self_0, __self_1),
                    EnumMember::NamedValue(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for EnumMember {
    #[inline]
    fn partial_cmp(&self, other: &EnumMember)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (EnumMember::Name(__self_0), EnumMember::Name(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (EnumMember::NamedValue(__self_0, __self_1),
                EnumMember::NamedValue(__arg1_0, __arg1_1)) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                    cmp => cmp,
                },
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for EnumMember {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<String>;
        let _: ::core::cmp::AssertParamIsEq<Expr>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for EnumMember {
    #[inline]
    fn cmp(&self, other: &EnumMember) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (EnumMember::Name(__self_0), EnumMember::Name(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (EnumMember::NamedValue(__self_0, __self_1),
                        EnumMember::NamedValue(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    _ => unsafe { ::core::intrinsics::unreachable() }
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for EnumMember {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            EnumMember::Name(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            EnumMember::NamedValue(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
        }
    }
}Hash)]
33#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
34#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for EnumMember {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Name(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::NamedValue(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for EnumMember {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Name(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::NamedValue(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
35/// A member of an ENUM type.
36pub enum EnumMember {
37    /// Just a name.
38    Name(String),
39    /// ClickHouse allows to specify an integer value for each enum value.
40    ///
41    /// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/data-types/enum)
42    NamedValue(String, Expr),
43}
44
45/// SQL data types
46#[derive(#[automatically_derived]
impl ::core::fmt::Debug for DataType {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            DataType::Table(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Table",
                    &__self_0),
            DataType::NamedTable { name: __self_0, columns: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "NamedTable", "name", __self_0, "columns", &__self_1),
            DataType::Character(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Character", &__self_0),
            DataType::Char(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Char",
                    &__self_0),
            DataType::CharacterVarying(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CharacterVarying", &__self_0),
            DataType::CharVarying(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CharVarying", &__self_0),
            DataType::Varchar(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Varchar", &__self_0),
            DataType::Nvarchar(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Nvarchar", &__self_0),
            DataType::Uuid => ::core::fmt::Formatter::write_str(f, "Uuid"),
            DataType::CharacterLargeObject(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CharacterLargeObject", &__self_0),
            DataType::CharLargeObject(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CharLargeObject", &__self_0),
            DataType::Clob(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Clob",
                    &__self_0),
            DataType::Binary(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Binary",
                    &__self_0),
            DataType::Varbinary(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Varbinary", &__self_0),
            DataType::Blob(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Blob",
                    &__self_0),
            DataType::TinyBlob =>
                ::core::fmt::Formatter::write_str(f, "TinyBlob"),
            DataType::MediumBlob =>
                ::core::fmt::Formatter::write_str(f, "MediumBlob"),
            DataType::LongBlob =>
                ::core::fmt::Formatter::write_str(f, "LongBlob"),
            DataType::Bytes(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Bytes",
                    &__self_0),
            DataType::Numeric(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Numeric", &__self_0),
            DataType::Decimal(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Decimal", &__self_0),
            DataType::DecimalUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DecimalUnsigned", &__self_0),
            DataType::BigNumeric(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BigNumeric", &__self_0),
            DataType::BigDecimal(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BigDecimal", &__self_0),
            DataType::Dec(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Dec",
                    &__self_0),
            DataType::DecUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DecUnsigned", &__self_0),
            DataType::Float(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Float",
                    &__self_0),
            DataType::FloatUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "FloatUnsigned", &__self_0),
            DataType::TinyInt(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TinyInt", &__self_0),
            DataType::TinyIntUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TinyIntUnsigned", &__self_0),
            DataType::UTinyInt =>
                ::core::fmt::Formatter::write_str(f, "UTinyInt"),
            DataType::Int2(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Int2",
                    &__self_0),
            DataType::Int2Unsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Int2Unsigned", &__self_0),
            DataType::SmallInt(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SmallInt", &__self_0),
            DataType::SmallIntUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SmallIntUnsigned", &__self_0),
            DataType::USmallInt =>
                ::core::fmt::Formatter::write_str(f, "USmallInt"),
            DataType::MediumInt(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "MediumInt", &__self_0),
            DataType::MediumIntUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "MediumIntUnsigned", &__self_0),
            DataType::Int(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Int",
                    &__self_0),
            DataType::Int4(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Int4",
                    &__self_0),
            DataType::Int8(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Int8",
                    &__self_0),
            DataType::Int16 => ::core::fmt::Formatter::write_str(f, "Int16"),
            DataType::Int32 => ::core::fmt::Formatter::write_str(f, "Int32"),
            DataType::Int64 => ::core::fmt::Formatter::write_str(f, "Int64"),
            DataType::Int128 =>
                ::core::fmt::Formatter::write_str(f, "Int128"),
            DataType::Int256 =>
                ::core::fmt::Formatter::write_str(f, "Int256"),
            DataType::Integer(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Integer", &__self_0),
            DataType::IntUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "IntUnsigned", &__self_0),
            DataType::Int4Unsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Int4Unsigned", &__self_0),
            DataType::IntegerUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "IntegerUnsigned", &__self_0),
            DataType::HugeInt =>
                ::core::fmt::Formatter::write_str(f, "HugeInt"),
            DataType::UHugeInt =>
                ::core::fmt::Formatter::write_str(f, "UHugeInt"),
            DataType::UInt8 => ::core::fmt::Formatter::write_str(f, "UInt8"),
            DataType::UInt16 =>
                ::core::fmt::Formatter::write_str(f, "UInt16"),
            DataType::UInt32 =>
                ::core::fmt::Formatter::write_str(f, "UInt32"),
            DataType::UInt64 =>
                ::core::fmt::Formatter::write_str(f, "UInt64"),
            DataType::UInt128 =>
                ::core::fmt::Formatter::write_str(f, "UInt128"),
            DataType::UInt256 =>
                ::core::fmt::Formatter::write_str(f, "UInt256"),
            DataType::BigInt(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "BigInt",
                    &__self_0),
            DataType::BigIntUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BigIntUnsigned", &__self_0),
            DataType::UBigInt =>
                ::core::fmt::Formatter::write_str(f, "UBigInt"),
            DataType::Int8Unsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Int8Unsigned", &__self_0),
            DataType::Signed =>
                ::core::fmt::Formatter::write_str(f, "Signed"),
            DataType::SignedInteger =>
                ::core::fmt::Formatter::write_str(f, "SignedInteger"),
            DataType::Unsigned =>
                ::core::fmt::Formatter::write_str(f, "Unsigned"),
            DataType::UnsignedInteger =>
                ::core::fmt::Formatter::write_str(f, "UnsignedInteger"),
            DataType::Float4 =>
                ::core::fmt::Formatter::write_str(f, "Float4"),
            DataType::Float32 =>
                ::core::fmt::Formatter::write_str(f, "Float32"),
            DataType::Float64 =>
                ::core::fmt::Formatter::write_str(f, "Float64"),
            DataType::Real => ::core::fmt::Formatter::write_str(f, "Real"),
            DataType::RealUnsigned =>
                ::core::fmt::Formatter::write_str(f, "RealUnsigned"),
            DataType::Float8 =>
                ::core::fmt::Formatter::write_str(f, "Float8"),
            DataType::Double(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Double",
                    &__self_0),
            DataType::DoubleUnsigned(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DoubleUnsigned", &__self_0),
            DataType::DoublePrecision =>
                ::core::fmt::Formatter::write_str(f, "DoublePrecision"),
            DataType::DoublePrecisionUnsigned =>
                ::core::fmt::Formatter::write_str(f,
                    "DoublePrecisionUnsigned"),
            DataType::Bool => ::core::fmt::Formatter::write_str(f, "Bool"),
            DataType::Boolean =>
                ::core::fmt::Formatter::write_str(f, "Boolean"),
            DataType::Date => ::core::fmt::Formatter::write_str(f, "Date"),
            DataType::Date32 =>
                ::core::fmt::Formatter::write_str(f, "Date32"),
            DataType::Time(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Time",
                    __self_0, &__self_1),
            DataType::Datetime(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Datetime", &__self_0),
            DataType::Datetime64(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Datetime64", __self_0, &__self_1),
            DataType::Timestamp(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Timestamp", __self_0, &__self_1),
            DataType::TimestampNtz(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TimestampNtz", &__self_0),
            DataType::Interval { fields: __self_0, precision: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Interval", "fields", __self_0, "precision", &__self_1),
            DataType::JSON => ::core::fmt::Formatter::write_str(f, "JSON"),
            DataType::JSONB => ::core::fmt::Formatter::write_str(f, "JSONB"),
            DataType::Regclass =>
                ::core::fmt::Formatter::write_str(f, "Regclass"),
            DataType::Text => ::core::fmt::Formatter::write_str(f, "Text"),
            DataType::TinyText =>
                ::core::fmt::Formatter::write_str(f, "TinyText"),
            DataType::MediumText =>
                ::core::fmt::Formatter::write_str(f, "MediumText"),
            DataType::LongText =>
                ::core::fmt::Formatter::write_str(f, "LongText"),
            DataType::String(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "String",
                    &__self_0),
            DataType::FixedString(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "FixedString", &__self_0),
            DataType::Bytea => ::core::fmt::Formatter::write_str(f, "Bytea"),
            DataType::Bit(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Bit",
                    &__self_0),
            DataType::BitVarying(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BitVarying", &__self_0),
            DataType::VarBit(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "VarBit",
                    &__self_0),
            DataType::Custom(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Custom",
                    __self_0, &__self_1),
            DataType::Array(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Array",
                    &__self_0),
            DataType::Map(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Map",
                    __self_0, &__self_1),
            DataType::Tuple(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Tuple",
                    &__self_0),
            DataType::Nested(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Nested",
                    &__self_0),
            DataType::Enum(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Enum",
                    __self_0, &__self_1),
            DataType::Set(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Set",
                    &__self_0),
            DataType::Struct(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Struct",
                    __self_0, &__self_1),
            DataType::Union(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Union",
                    &__self_0),
            DataType::Nullable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Nullable", &__self_0),
            DataType::LowCardinality(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LowCardinality", &__self_0),
            DataType::Unspecified =>
                ::core::fmt::Formatter::write_str(f, "Unspecified"),
            DataType::Trigger =>
                ::core::fmt::Formatter::write_str(f, "Trigger"),
            DataType::AnyType =>
                ::core::fmt::Formatter::write_str(f, "AnyType"),
            DataType::GeometricType(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "GeometricType", &__self_0),
            DataType::TsVector =>
                ::core::fmt::Formatter::write_str(f, "TsVector"),
            DataType::TsQuery =>
                ::core::fmt::Formatter::write_str(f, "TsQuery"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for DataType {
    #[inline]
    fn clone(&self) -> DataType {
        match self {
            DataType::Table(__self_0) =>
                DataType::Table(::core::clone::Clone::clone(__self_0)),
            DataType::NamedTable { name: __self_0, columns: __self_1 } =>
                DataType::NamedTable {
                    name: ::core::clone::Clone::clone(__self_0),
                    columns: ::core::clone::Clone::clone(__self_1),
                },
            DataType::Character(__self_0) =>
                DataType::Character(::core::clone::Clone::clone(__self_0)),
            DataType::Char(__self_0) =>
                DataType::Char(::core::clone::Clone::clone(__self_0)),
            DataType::CharacterVarying(__self_0) =>
                DataType::CharacterVarying(::core::clone::Clone::clone(__self_0)),
            DataType::CharVarying(__self_0) =>
                DataType::CharVarying(::core::clone::Clone::clone(__self_0)),
            DataType::Varchar(__self_0) =>
                DataType::Varchar(::core::clone::Clone::clone(__self_0)),
            DataType::Nvarchar(__self_0) =>
                DataType::Nvarchar(::core::clone::Clone::clone(__self_0)),
            DataType::Uuid => DataType::Uuid,
            DataType::CharacterLargeObject(__self_0) =>
                DataType::CharacterLargeObject(::core::clone::Clone::clone(__self_0)),
            DataType::CharLargeObject(__self_0) =>
                DataType::CharLargeObject(::core::clone::Clone::clone(__self_0)),
            DataType::Clob(__self_0) =>
                DataType::Clob(::core::clone::Clone::clone(__self_0)),
            DataType::Binary(__self_0) =>
                DataType::Binary(::core::clone::Clone::clone(__self_0)),
            DataType::Varbinary(__self_0) =>
                DataType::Varbinary(::core::clone::Clone::clone(__self_0)),
            DataType::Blob(__self_0) =>
                DataType::Blob(::core::clone::Clone::clone(__self_0)),
            DataType::TinyBlob => DataType::TinyBlob,
            DataType::MediumBlob => DataType::MediumBlob,
            DataType::LongBlob => DataType::LongBlob,
            DataType::Bytes(__self_0) =>
                DataType::Bytes(::core::clone::Clone::clone(__self_0)),
            DataType::Numeric(__self_0) =>
                DataType::Numeric(::core::clone::Clone::clone(__self_0)),
            DataType::Decimal(__self_0) =>
                DataType::Decimal(::core::clone::Clone::clone(__self_0)),
            DataType::DecimalUnsigned(__self_0) =>
                DataType::DecimalUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::BigNumeric(__self_0) =>
                DataType::BigNumeric(::core::clone::Clone::clone(__self_0)),
            DataType::BigDecimal(__self_0) =>
                DataType::BigDecimal(::core::clone::Clone::clone(__self_0)),
            DataType::Dec(__self_0) =>
                DataType::Dec(::core::clone::Clone::clone(__self_0)),
            DataType::DecUnsigned(__self_0) =>
                DataType::DecUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::Float(__self_0) =>
                DataType::Float(::core::clone::Clone::clone(__self_0)),
            DataType::FloatUnsigned(__self_0) =>
                DataType::FloatUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::TinyInt(__self_0) =>
                DataType::TinyInt(::core::clone::Clone::clone(__self_0)),
            DataType::TinyIntUnsigned(__self_0) =>
                DataType::TinyIntUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::UTinyInt => DataType::UTinyInt,
            DataType::Int2(__self_0) =>
                DataType::Int2(::core::clone::Clone::clone(__self_0)),
            DataType::Int2Unsigned(__self_0) =>
                DataType::Int2Unsigned(::core::clone::Clone::clone(__self_0)),
            DataType::SmallInt(__self_0) =>
                DataType::SmallInt(::core::clone::Clone::clone(__self_0)),
            DataType::SmallIntUnsigned(__self_0) =>
                DataType::SmallIntUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::USmallInt => DataType::USmallInt,
            DataType::MediumInt(__self_0) =>
                DataType::MediumInt(::core::clone::Clone::clone(__self_0)),
            DataType::MediumIntUnsigned(__self_0) =>
                DataType::MediumIntUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::Int(__self_0) =>
                DataType::Int(::core::clone::Clone::clone(__self_0)),
            DataType::Int4(__self_0) =>
                DataType::Int4(::core::clone::Clone::clone(__self_0)),
            DataType::Int8(__self_0) =>
                DataType::Int8(::core::clone::Clone::clone(__self_0)),
            DataType::Int16 => DataType::Int16,
            DataType::Int32 => DataType::Int32,
            DataType::Int64 => DataType::Int64,
            DataType::Int128 => DataType::Int128,
            DataType::Int256 => DataType::Int256,
            DataType::Integer(__self_0) =>
                DataType::Integer(::core::clone::Clone::clone(__self_0)),
            DataType::IntUnsigned(__self_0) =>
                DataType::IntUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::Int4Unsigned(__self_0) =>
                DataType::Int4Unsigned(::core::clone::Clone::clone(__self_0)),
            DataType::IntegerUnsigned(__self_0) =>
                DataType::IntegerUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::HugeInt => DataType::HugeInt,
            DataType::UHugeInt => DataType::UHugeInt,
            DataType::UInt8 => DataType::UInt8,
            DataType::UInt16 => DataType::UInt16,
            DataType::UInt32 => DataType::UInt32,
            DataType::UInt64 => DataType::UInt64,
            DataType::UInt128 => DataType::UInt128,
            DataType::UInt256 => DataType::UInt256,
            DataType::BigInt(__self_0) =>
                DataType::BigInt(::core::clone::Clone::clone(__self_0)),
            DataType::BigIntUnsigned(__self_0) =>
                DataType::BigIntUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::UBigInt => DataType::UBigInt,
            DataType::Int8Unsigned(__self_0) =>
                DataType::Int8Unsigned(::core::clone::Clone::clone(__self_0)),
            DataType::Signed => DataType::Signed,
            DataType::SignedInteger => DataType::SignedInteger,
            DataType::Unsigned => DataType::Unsigned,
            DataType::UnsignedInteger => DataType::UnsignedInteger,
            DataType::Float4 => DataType::Float4,
            DataType::Float32 => DataType::Float32,
            DataType::Float64 => DataType::Float64,
            DataType::Real => DataType::Real,
            DataType::RealUnsigned => DataType::RealUnsigned,
            DataType::Float8 => DataType::Float8,
            DataType::Double(__self_0) =>
                DataType::Double(::core::clone::Clone::clone(__self_0)),
            DataType::DoubleUnsigned(__self_0) =>
                DataType::DoubleUnsigned(::core::clone::Clone::clone(__self_0)),
            DataType::DoublePrecision => DataType::DoublePrecision,
            DataType::DoublePrecisionUnsigned =>
                DataType::DoublePrecisionUnsigned,
            DataType::Bool => DataType::Bool,
            DataType::Boolean => DataType::Boolean,
            DataType::Date => DataType::Date,
            DataType::Date32 => DataType::Date32,
            DataType::Time(__self_0, __self_1) =>
                DataType::Time(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Datetime(__self_0) =>
                DataType::Datetime(::core::clone::Clone::clone(__self_0)),
            DataType::Datetime64(__self_0, __self_1) =>
                DataType::Datetime64(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Timestamp(__self_0, __self_1) =>
                DataType::Timestamp(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::TimestampNtz(__self_0) =>
                DataType::TimestampNtz(::core::clone::Clone::clone(__self_0)),
            DataType::Interval { fields: __self_0, precision: __self_1 } =>
                DataType::Interval {
                    fields: ::core::clone::Clone::clone(__self_0),
                    precision: ::core::clone::Clone::clone(__self_1),
                },
            DataType::JSON => DataType::JSON,
            DataType::JSONB => DataType::JSONB,
            DataType::Regclass => DataType::Regclass,
            DataType::Text => DataType::Text,
            DataType::TinyText => DataType::TinyText,
            DataType::MediumText => DataType::MediumText,
            DataType::LongText => DataType::LongText,
            DataType::String(__self_0) =>
                DataType::String(::core::clone::Clone::clone(__self_0)),
            DataType::FixedString(__self_0) =>
                DataType::FixedString(::core::clone::Clone::clone(__self_0)),
            DataType::Bytea => DataType::Bytea,
            DataType::Bit(__self_0) =>
                DataType::Bit(::core::clone::Clone::clone(__self_0)),
            DataType::BitVarying(__self_0) =>
                DataType::BitVarying(::core::clone::Clone::clone(__self_0)),
            DataType::VarBit(__self_0) =>
                DataType::VarBit(::core::clone::Clone::clone(__self_0)),
            DataType::Custom(__self_0, __self_1) =>
                DataType::Custom(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Array(__self_0) =>
                DataType::Array(::core::clone::Clone::clone(__self_0)),
            DataType::Map(__self_0, __self_1) =>
                DataType::Map(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Tuple(__self_0) =>
                DataType::Tuple(::core::clone::Clone::clone(__self_0)),
            DataType::Nested(__self_0) =>
                DataType::Nested(::core::clone::Clone::clone(__self_0)),
            DataType::Enum(__self_0, __self_1) =>
                DataType::Enum(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Set(__self_0) =>
                DataType::Set(::core::clone::Clone::clone(__self_0)),
            DataType::Struct(__self_0, __self_1) =>
                DataType::Struct(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DataType::Union(__self_0) =>
                DataType::Union(::core::clone::Clone::clone(__self_0)),
            DataType::Nullable(__self_0) =>
                DataType::Nullable(::core::clone::Clone::clone(__self_0)),
            DataType::LowCardinality(__self_0) =>
                DataType::LowCardinality(::core::clone::Clone::clone(__self_0)),
            DataType::Unspecified => DataType::Unspecified,
            DataType::Trigger => DataType::Trigger,
            DataType::AnyType => DataType::AnyType,
            DataType::GeometricType(__self_0) =>
                DataType::GeometricType(::core::clone::Clone::clone(__self_0)),
            DataType::TsVector => DataType::TsVector,
            DataType::TsQuery => DataType::TsQuery,
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for DataType {
    #[inline]
    fn eq(&self, other: &DataType) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (DataType::Table(__self_0), DataType::Table(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::NamedTable { name: __self_0, columns: __self_1 },
                    DataType::NamedTable { name: __arg1_0, columns: __arg1_1 })
                    => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Character(__self_0), DataType::Character(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::Char(__self_0), DataType::Char(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::CharacterVarying(__self_0),
                    DataType::CharacterVarying(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::CharVarying(__self_0),
                    DataType::CharVarying(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Varchar(__self_0), DataType::Varchar(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Nvarchar(__self_0), DataType::Nvarchar(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::CharacterLargeObject(__self_0),
                    DataType::CharacterLargeObject(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::CharLargeObject(__self_0),
                    DataType::CharLargeObject(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Clob(__self_0), DataType::Clob(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Binary(__self_0), DataType::Binary(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Varbinary(__self_0), DataType::Varbinary(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::Blob(__self_0), DataType::Blob(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Bytes(__self_0), DataType::Bytes(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Numeric(__self_0), DataType::Numeric(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Decimal(__self_0), DataType::Decimal(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::DecimalUnsigned(__self_0),
                    DataType::DecimalUnsigned(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::BigNumeric(__self_0),
                    DataType::BigNumeric(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::BigDecimal(__self_0),
                    DataType::BigDecimal(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Dec(__self_0), DataType::Dec(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::DecUnsigned(__self_0),
                    DataType::DecUnsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Float(__self_0), DataType::Float(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::FloatUnsigned(__self_0),
                    DataType::FloatUnsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::TinyInt(__self_0), DataType::TinyInt(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::TinyIntUnsigned(__self_0),
                    DataType::TinyIntUnsigned(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Int2(__self_0), DataType::Int2(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Int2Unsigned(__self_0),
                    DataType::Int2Unsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::SmallInt(__self_0), DataType::SmallInt(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::SmallIntUnsigned(__self_0),
                    DataType::SmallIntUnsigned(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::MediumInt(__self_0), DataType::MediumInt(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::MediumIntUnsigned(__self_0),
                    DataType::MediumIntUnsigned(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Int(__self_0), DataType::Int(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Int4(__self_0), DataType::Int4(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Int8(__self_0), DataType::Int8(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Integer(__self_0), DataType::Integer(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::IntUnsigned(__self_0),
                    DataType::IntUnsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Int4Unsigned(__self_0),
                    DataType::Int4Unsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::IntegerUnsigned(__self_0),
                    DataType::IntegerUnsigned(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::BigInt(__self_0), DataType::BigInt(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::BigIntUnsigned(__self_0),
                    DataType::BigIntUnsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Int8Unsigned(__self_0),
                    DataType::Int8Unsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Double(__self_0), DataType::Double(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::DoubleUnsigned(__self_0),
                    DataType::DoubleUnsigned(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Time(__self_0, __self_1),
                    DataType::Time(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Datetime(__self_0), DataType::Datetime(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::Datetime64(__self_0, __self_1),
                    DataType::Datetime64(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Timestamp(__self_0, __self_1),
                    DataType::Timestamp(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::TimestampNtz(__self_0),
                    DataType::TimestampNtz(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Interval { fields: __self_0, precision: __self_1 },
                    DataType::Interval { fields: __arg1_0, precision: __arg1_1
                    }) => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::String(__self_0), DataType::String(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::FixedString(__self_0),
                    DataType::FixedString(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::Bit(__self_0), DataType::Bit(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::BitVarying(__self_0),
                    DataType::BitVarying(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::VarBit(__self_0), DataType::VarBit(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Custom(__self_0, __self_1),
                    DataType::Custom(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Array(__self_0), DataType::Array(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Map(__self_0, __self_1),
                    DataType::Map(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Tuple(__self_0), DataType::Tuple(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Nested(__self_0), DataType::Nested(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Enum(__self_0, __self_1),
                    DataType::Enum(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Set(__self_0), DataType::Set(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Struct(__self_0, __self_1),
                    DataType::Struct(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DataType::Union(__self_0), DataType::Union(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DataType::Nullable(__self_0), DataType::Nullable(__arg1_0))
                    => __self_0 == __arg1_0,
                (DataType::LowCardinality(__self_0),
                    DataType::LowCardinality(__arg1_0)) => __self_0 == __arg1_0,
                (DataType::GeometricType(__self_0),
                    DataType::GeometricType(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for DataType {
    #[inline]
    fn partial_cmp(&self, other: &DataType)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                &__arg1_discr) {
            ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
                match (self, other) {
                    (DataType::Table(__self_0), DataType::Table(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::NamedTable { name: __self_0, columns: __self_1 },
                        DataType::NamedTable { name: __arg1_0, columns: __arg1_1 })
                        =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Character(__self_0),
                        DataType::Character(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Char(__self_0), DataType::Char(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::CharacterVarying(__self_0),
                        DataType::CharacterVarying(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::CharVarying(__self_0),
                        DataType::CharVarying(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Varchar(__self_0), DataType::Varchar(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Nvarchar(__self_0), DataType::Nvarchar(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::CharacterLargeObject(__self_0),
                        DataType::CharacterLargeObject(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::CharLargeObject(__self_0),
                        DataType::CharLargeObject(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Clob(__self_0), DataType::Clob(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Binary(__self_0), DataType::Binary(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Varbinary(__self_0),
                        DataType::Varbinary(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Blob(__self_0), DataType::Blob(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Bytes(__self_0), DataType::Bytes(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Numeric(__self_0), DataType::Numeric(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Decimal(__self_0), DataType::Decimal(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::DecimalUnsigned(__self_0),
                        DataType::DecimalUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::BigNumeric(__self_0),
                        DataType::BigNumeric(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::BigDecimal(__self_0),
                        DataType::BigDecimal(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Dec(__self_0), DataType::Dec(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::DecUnsigned(__self_0),
                        DataType::DecUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Float(__self_0), DataType::Float(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::FloatUnsigned(__self_0),
                        DataType::FloatUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::TinyInt(__self_0), DataType::TinyInt(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::TinyIntUnsigned(__self_0),
                        DataType::TinyIntUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int2(__self_0), DataType::Int2(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int2Unsigned(__self_0),
                        DataType::Int2Unsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::SmallInt(__self_0), DataType::SmallInt(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::SmallIntUnsigned(__self_0),
                        DataType::SmallIntUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::MediumInt(__self_0),
                        DataType::MediumInt(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::MediumIntUnsigned(__self_0),
                        DataType::MediumIntUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int(__self_0), DataType::Int(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int4(__self_0), DataType::Int4(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int8(__self_0), DataType::Int8(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Integer(__self_0), DataType::Integer(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::IntUnsigned(__self_0),
                        DataType::IntUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int4Unsigned(__self_0),
                        DataType::Int4Unsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::IntegerUnsigned(__self_0),
                        DataType::IntegerUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::BigInt(__self_0), DataType::BigInt(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::BigIntUnsigned(__self_0),
                        DataType::BigIntUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Int8Unsigned(__self_0),
                        DataType::Int8Unsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Double(__self_0), DataType::Double(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::DoubleUnsigned(__self_0),
                        DataType::DoubleUnsigned(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Time(__self_0, __self_1),
                        DataType::Time(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Datetime(__self_0), DataType::Datetime(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Datetime64(__self_0, __self_1),
                        DataType::Datetime64(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Timestamp(__self_0, __self_1),
                        DataType::Timestamp(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::TimestampNtz(__self_0),
                        DataType::TimestampNtz(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Interval { fields: __self_0, precision: __self_1
                        }, DataType::Interval {
                        fields: __arg1_0, precision: __arg1_1 }) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::String(__self_0), DataType::String(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::FixedString(__self_0),
                        DataType::FixedString(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Bit(__self_0), DataType::Bit(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::BitVarying(__self_0),
                        DataType::BitVarying(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::VarBit(__self_0), DataType::VarBit(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Custom(__self_0, __self_1),
                        DataType::Custom(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Array(__self_0), DataType::Array(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Map(__self_0, __self_1),
                        DataType::Map(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Tuple(__self_0), DataType::Tuple(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Nested(__self_0), DataType::Nested(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Enum(__self_0, __self_1),
                        DataType::Enum(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Set(__self_0), DataType::Set(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Struct(__self_0, __self_1),
                        DataType::Struct(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_0,
                                __arg1_0) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Union(__self_0), DataType::Union(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::Nullable(__self_0), DataType::Nullable(__arg1_0))
                        => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::LowCardinality(__self_0),
                        DataType::LowCardinality(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    (DataType::GeometricType(__self_0),
                        DataType::GeometricType(__arg1_0)) =>
                        ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
                    _ =>
                        ::core::option::Option::Some(::core::cmp::Ordering::Equal),
                },
            cmp => cmp,
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for DataType {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<Vec<ColumnDef>>>;
        let _: ::core::cmp::AssertParamIsEq<ObjectName>;
        let _: ::core::cmp::AssertParamIsEq<Vec<ColumnDef>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharacterLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<BinaryLength>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<ExactNumberInfo>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<TimezoneInfo>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<u64>;
        let _: ::core::cmp::AssertParamIsEq<Option<String>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<IntervalFields>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<String>>;
        let _: ::core::cmp::AssertParamIsEq<ArrayElemTypeDef>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<StructField>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<ColumnDef>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<EnumMember>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u8>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<String>>;
        let _: ::core::cmp::AssertParamIsEq<Vec<StructField>>;
        let _: ::core::cmp::AssertParamIsEq<StructBracketKind>;
        let _: ::core::cmp::AssertParamIsEq<Vec<UnionField>>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<GeometricTypeKind>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for DataType {
    #[inline]
    fn cmp(&self, other: &DataType) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (DataType::Table(__self_0), DataType::Table(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::NamedTable { name: __self_0, columns: __self_1 },
                        DataType::NamedTable { name: __arg1_0, columns: __arg1_1 })
                        =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Character(__self_0),
                        DataType::Character(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Char(__self_0), DataType::Char(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::CharacterVarying(__self_0),
                        DataType::CharacterVarying(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::CharVarying(__self_0),
                        DataType::CharVarying(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Varchar(__self_0), DataType::Varchar(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Nvarchar(__self_0), DataType::Nvarchar(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::CharacterLargeObject(__self_0),
                        DataType::CharacterLargeObject(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::CharLargeObject(__self_0),
                        DataType::CharLargeObject(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Clob(__self_0), DataType::Clob(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Binary(__self_0), DataType::Binary(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Varbinary(__self_0),
                        DataType::Varbinary(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Blob(__self_0), DataType::Blob(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Bytes(__self_0), DataType::Bytes(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Numeric(__self_0), DataType::Numeric(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Decimal(__self_0), DataType::Decimal(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::DecimalUnsigned(__self_0),
                        DataType::DecimalUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::BigNumeric(__self_0),
                        DataType::BigNumeric(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::BigDecimal(__self_0),
                        DataType::BigDecimal(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Dec(__self_0), DataType::Dec(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::DecUnsigned(__self_0),
                        DataType::DecUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Float(__self_0), DataType::Float(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::FloatUnsigned(__self_0),
                        DataType::FloatUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::TinyInt(__self_0), DataType::TinyInt(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::TinyIntUnsigned(__self_0),
                        DataType::TinyIntUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int2(__self_0), DataType::Int2(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int2Unsigned(__self_0),
                        DataType::Int2Unsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::SmallInt(__self_0), DataType::SmallInt(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::SmallIntUnsigned(__self_0),
                        DataType::SmallIntUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::MediumInt(__self_0),
                        DataType::MediumInt(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::MediumIntUnsigned(__self_0),
                        DataType::MediumIntUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int(__self_0), DataType::Int(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int4(__self_0), DataType::Int4(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int8(__self_0), DataType::Int8(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Integer(__self_0), DataType::Integer(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::IntUnsigned(__self_0),
                        DataType::IntUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int4Unsigned(__self_0),
                        DataType::Int4Unsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::IntegerUnsigned(__self_0),
                        DataType::IntegerUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::BigInt(__self_0), DataType::BigInt(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::BigIntUnsigned(__self_0),
                        DataType::BigIntUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Int8Unsigned(__self_0),
                        DataType::Int8Unsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Double(__self_0), DataType::Double(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::DoubleUnsigned(__self_0),
                        DataType::DoubleUnsigned(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Time(__self_0, __self_1),
                        DataType::Time(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Datetime(__self_0), DataType::Datetime(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Datetime64(__self_0, __self_1),
                        DataType::Datetime64(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Timestamp(__self_0, __self_1),
                        DataType::Timestamp(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::TimestampNtz(__self_0),
                        DataType::TimestampNtz(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Interval { fields: __self_0, precision: __self_1
                        }, DataType::Interval {
                        fields: __arg1_0, precision: __arg1_1 }) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::String(__self_0), DataType::String(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::FixedString(__self_0),
                        DataType::FixedString(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Bit(__self_0), DataType::Bit(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::BitVarying(__self_0),
                        DataType::BitVarying(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::VarBit(__self_0), DataType::VarBit(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Custom(__self_0, __self_1),
                        DataType::Custom(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Array(__self_0), DataType::Array(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Map(__self_0, __self_1),
                        DataType::Map(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Tuple(__self_0), DataType::Tuple(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Nested(__self_0), DataType::Nested(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Enum(__self_0, __self_1),
                        DataType::Enum(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Set(__self_0), DataType::Set(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Struct(__self_0, __self_1),
                        DataType::Struct(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DataType::Union(__self_0), DataType::Union(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::Nullable(__self_0), DataType::Nullable(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::LowCardinality(__self_0),
                        DataType::LowCardinality(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (DataType::GeometricType(__self_0),
                        DataType::GeometricType(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for DataType {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            DataType::Table(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::NamedTable { name: __self_0, columns: __self_1 } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Character(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Char(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::CharacterVarying(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::CharVarying(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Varchar(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Nvarchar(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::CharacterLargeObject(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::CharLargeObject(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Clob(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Binary(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Varbinary(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Blob(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Bytes(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Numeric(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Decimal(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::DecimalUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::BigNumeric(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::BigDecimal(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Dec(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::DecUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Float(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::FloatUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::TinyInt(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::TinyIntUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int2(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int2Unsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::SmallInt(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::SmallIntUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::MediumInt(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::MediumIntUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int4(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int8(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Integer(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::IntUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int4Unsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::IntegerUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::BigInt(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::BigIntUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Int8Unsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Double(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::DoubleUnsigned(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Time(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Datetime(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Datetime64(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Timestamp(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::TimestampNtz(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Interval { fields: __self_0, precision: __self_1 } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::String(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::FixedString(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Bit(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::BitVarying(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::VarBit(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Custom(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Array(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Map(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Tuple(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Nested(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Enum(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Set(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Struct(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DataType::Union(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::Nullable(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::LowCardinality(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DataType::GeometricType(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
47#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
48#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for DataType {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Table(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::NamedTable { name, columns } => {
                                sqlparser::ast::Visit::visit(name, visitor)?;
                                sqlparser::ast::Visit::visit(columns, visitor)?;
                            }
                            Self::Character(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Char(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::CharacterVarying(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::CharVarying(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Varchar(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Nvarchar(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Uuid => {}
                            Self::CharacterLargeObject(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::CharLargeObject(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Clob(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Binary(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Varbinary(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Blob(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::TinyBlob => {}
                            Self::MediumBlob => {}
                            Self::LongBlob => {}
                            Self::Bytes(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Numeric(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Decimal(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::DecimalUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::BigNumeric(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::BigDecimal(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Dec(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::DecUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Float(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::FloatUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::TinyInt(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::TinyIntUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::UTinyInt => {}
                            Self::Int2(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int2Unsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::SmallInt(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::SmallIntUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::USmallInt => {}
                            Self::MediumInt(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::MediumIntUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int4(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int8(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int16 => {}
                            Self::Int32 => {}
                            Self::Int64 => {}
                            Self::Int128 => {}
                            Self::Int256 => {}
                            Self::Integer(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::IntUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Int4Unsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::IntegerUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::HugeInt => {}
                            Self::UHugeInt => {}
                            Self::UInt8 => {}
                            Self::UInt16 => {}
                            Self::UInt32 => {}
                            Self::UInt64 => {}
                            Self::UInt128 => {}
                            Self::UInt256 => {}
                            Self::BigInt(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::BigIntUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::UBigInt => {}
                            Self::Int8Unsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Signed => {}
                            Self::SignedInteger => {}
                            Self::Unsigned => {}
                            Self::UnsignedInteger => {}
                            Self::Float4 => {}
                            Self::Float32 => {}
                            Self::Float64 => {}
                            Self::Real => {}
                            Self::RealUnsigned => {}
                            Self::Float8 => {}
                            Self::Double(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::DoubleUnsigned(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::DoublePrecision => {}
                            Self::DoublePrecisionUnsigned => {}
                            Self::Bool => {}
                            Self::Boolean => {}
                            Self::Date => {}
                            Self::Date32 => {}
                            Self::Time(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Datetime(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Datetime64(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Timestamp(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::TimestampNtz(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Interval { fields, precision } => {
                                sqlparser::ast::Visit::visit(fields, visitor)?;
                                sqlparser::ast::Visit::visit(precision, visitor)?;
                            }
                            Self::JSON => {}
                            Self::JSONB => {}
                            Self::Regclass => {}
                            Self::Text => {}
                            Self::TinyText => {}
                            Self::MediumText => {}
                            Self::LongText => {}
                            Self::String(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::FixedString(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Bytea => {}
                            Self::Bit(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::BitVarying(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::VarBit(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Custom(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Array(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Map(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Tuple(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Nested(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Enum(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Set(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Struct(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Union(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Nullable(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::LowCardinality(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::Unspecified => {}
                            Self::Trigger => {}
                            Self::AnyType => {}
                            Self::GeometricType(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::TsVector => {}
                            Self::TsQuery => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for DataType {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Table(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::NamedTable { name, columns } => {
                                sqlparser::ast::VisitMut::visit(name, visitor)?;
                                sqlparser::ast::VisitMut::visit(columns, visitor)?;
                            }
                            Self::Character(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Char(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::CharacterVarying(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::CharVarying(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Varchar(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Nvarchar(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Uuid => {}
                            Self::CharacterLargeObject(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::CharLargeObject(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Clob(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Binary(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Varbinary(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Blob(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::TinyBlob => {}
                            Self::MediumBlob => {}
                            Self::LongBlob => {}
                            Self::Bytes(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Numeric(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Decimal(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::DecimalUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::BigNumeric(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::BigDecimal(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Dec(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::DecUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Float(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::FloatUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::TinyInt(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::TinyIntUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::UTinyInt => {}
                            Self::Int2(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int2Unsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::SmallInt(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::SmallIntUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::USmallInt => {}
                            Self::MediumInt(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::MediumIntUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int4(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int8(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int16 => {}
                            Self::Int32 => {}
                            Self::Int64 => {}
                            Self::Int128 => {}
                            Self::Int256 => {}
                            Self::Integer(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::IntUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Int4Unsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::IntegerUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::HugeInt => {}
                            Self::UHugeInt => {}
                            Self::UInt8 => {}
                            Self::UInt16 => {}
                            Self::UInt32 => {}
                            Self::UInt64 => {}
                            Self::UInt128 => {}
                            Self::UInt256 => {}
                            Self::BigInt(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::BigIntUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::UBigInt => {}
                            Self::Int8Unsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Signed => {}
                            Self::SignedInteger => {}
                            Self::Unsigned => {}
                            Self::UnsignedInteger => {}
                            Self::Float4 => {}
                            Self::Float32 => {}
                            Self::Float64 => {}
                            Self::Real => {}
                            Self::RealUnsigned => {}
                            Self::Float8 => {}
                            Self::Double(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::DoubleUnsigned(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::DoublePrecision => {}
                            Self::DoublePrecisionUnsigned => {}
                            Self::Bool => {}
                            Self::Boolean => {}
                            Self::Date => {}
                            Self::Date32 => {}
                            Self::Time(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Datetime(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Datetime64(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Timestamp(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::TimestampNtz(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Interval { fields, precision } => {
                                sqlparser::ast::VisitMut::visit(fields, visitor)?;
                                sqlparser::ast::VisitMut::visit(precision, visitor)?;
                            }
                            Self::JSON => {}
                            Self::JSONB => {}
                            Self::Regclass => {}
                            Self::Text => {}
                            Self::TinyText => {}
                            Self::MediumText => {}
                            Self::LongText => {}
                            Self::String(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::FixedString(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Bytea => {}
                            Self::Bit(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::BitVarying(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::VarBit(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Custom(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Array(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Map(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Tuple(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Nested(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Enum(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Set(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Struct(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Union(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Nullable(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::LowCardinality(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::Unspecified => {}
                            Self::Trigger => {}
                            Self::AnyType => {}
                            Self::GeometricType(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::TsVector => {}
                            Self::TsQuery => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
49pub enum DataType {
50    /// Table type in [PostgreSQL], e.g. CREATE FUNCTION RETURNS TABLE(...).
51    ///
52    /// [PostgreSQL]: https://www.postgresql.org/docs/15/sql-createfunction.html
53    /// [MsSQL]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql?view=sql-server-ver16#c-create-a-multi-statement-table-valued-function
54    Table(Option<Vec<ColumnDef>>),
55    /// Table type with a name, e.g. CREATE FUNCTION RETURNS @result TABLE(...).
56    ///
57    /// [MsSQl]: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql?view=sql-server-ver16#table
58    NamedTable {
59        /// Table name.
60        name: ObjectName,
61        /// Table columns.
62        columns: Vec<ColumnDef>,
63    },
64    /// Fixed-length character type, e.g. CHARACTER(10).
65    Character(Option<CharacterLength>),
66    /// Fixed-length char type, e.g. CHAR(10).
67    Char(Option<CharacterLength>),
68    /// Character varying type, e.g. CHARACTER VARYING(10).
69    CharacterVarying(Option<CharacterLength>),
70    /// Char varying type, e.g. CHAR VARYING(10).
71    CharVarying(Option<CharacterLength>),
72    /// Variable-length character type, e.g. VARCHAR(10).
73    Varchar(Option<CharacterLength>),
74    /// Variable-length character type, e.g. NVARCHAR(10).
75    Nvarchar(Option<CharacterLength>),
76    /// Uuid type.
77    Uuid,
78    /// Large character object with optional length,
79    /// e.g. CHARACTER LARGE OBJECT, CHARACTER LARGE OBJECT(1000), [SQL Standard].
80    ///
81    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-large-object-type
82    CharacterLargeObject(Option<u64>),
83    /// Large character object with optional length,
84    /// e.g. CHAR LARGE OBJECT, CHAR LARGE OBJECT(1000), [SQL Standard].
85    ///
86    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-large-object-type
87    CharLargeObject(Option<u64>),
88    /// Large character object with optional length,
89    /// e.g. CLOB, CLOB(1000), [SQL Standard].
90    ///
91    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-large-object-type
92    /// [Oracle]: https://docs.oracle.com/javadb/10.10.1.2/ref/rrefclob.html
93    Clob(Option<u64>),
94    /// Fixed-length binary type with optional length,
95    /// see [SQL Standard], [MS SQL Server].
96    ///
97    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-string-type
98    /// [MS SQL Server]: https://learn.microsoft.com/pt-br/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=sql-server-ver16
99    Binary(Option<u64>),
100    /// Variable-length binary with optional length type,
101    /// see [SQL Standard], [MS SQL Server].
102    ///
103    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-string-type
104    /// [MS SQL Server]: https://learn.microsoft.com/pt-br/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=sql-server-ver16
105    Varbinary(Option<BinaryLength>),
106    /// Large binary object with optional length,
107    /// see [SQL Standard], [Oracle].
108    ///
109    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-large-object-string-type
110    /// [Oracle]: https://docs.oracle.com/javadb/10.8.3.0/ref/rrefblob.html
111    Blob(Option<u64>),
112    /// [MySQL] blob with up to 2**8 bytes.
113    ///
114    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
115    TinyBlob,
116    /// [MySQL] blob with up to 2**24 bytes.
117    ///
118    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
119    MediumBlob,
120    /// [MySQL] blob with up to 2**32 bytes.
121    ///
122    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
123    LongBlob,
124    /// Variable-length binary data with optional length.
125    ///
126    /// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#bytes_type
127    Bytes(Option<u64>),
128    /// Numeric type with optional precision and scale, e.g. NUMERIC(10,2), [SQL Standard][1].
129    ///
130    /// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
131    Numeric(ExactNumberInfo),
132    /// Decimal type with optional precision and scale, e.g. DECIMAL(10,2), [SQL Standard][1].
133    ///
134    /// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
135    Decimal(ExactNumberInfo),
136    /// [MySQL] unsigned decimal with optional precision and scale, e.g. DECIMAL UNSIGNED or DECIMAL(10,2) UNSIGNED.
137    /// Note: Using UNSIGNED with DECIMAL is deprecated in recent versions of MySQL.
138    ///
139    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
140    DecimalUnsigned(ExactNumberInfo),
141    /// [BigNumeric] type used in BigQuery.
142    ///
143    /// [BigNumeric]: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#bignumeric_literals
144    BigNumeric(ExactNumberInfo),
145    /// This is alias for `BigNumeric` type used in BigQuery.
146    ///
147    /// [BigDecimal]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types
148    BigDecimal(ExactNumberInfo),
149    /// Dec type with optional precision and scale, e.g. DEC(10,2), [SQL Standard][1].
150    ///
151    /// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
152    Dec(ExactNumberInfo),
153    /// [MySQL] unsigned decimal (DEC alias) with optional precision and scale, e.g. DEC UNSIGNED or DEC(10,2) UNSIGNED.
154    /// Note: Using UNSIGNED with DEC is deprecated in recent versions of MySQL.
155    ///
156    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
157    DecUnsigned(ExactNumberInfo),
158    /// Floating point with optional precision and scale, e.g. FLOAT, FLOAT(8), or FLOAT(8,2).
159    Float(ExactNumberInfo),
160    /// [MySQL] unsigned floating point with optional precision and scale, e.g.
161    /// FLOAT UNSIGNED, FLOAT(10) UNSIGNED or FLOAT(10,2) UNSIGNED.
162    /// Note: Using UNSIGNED with FLOAT is deprecated in recent versions of MySQL.
163    ///
164    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
165    FloatUnsigned(ExactNumberInfo),
166    /// Tiny integer with optional display width, e.g. TINYINT or TINYINT(3).
167    TinyInt(Option<u64>),
168    /// Unsigned tiny integer with optional display width,
169    /// e.g. TINYINT UNSIGNED or TINYINT(3) UNSIGNED.
170    TinyIntUnsigned(Option<u64>),
171    /// Unsigned tiny integer, e.g. UTINYINT
172    UTinyInt,
173    /// Int2 is an alias for SmallInt in [PostgreSQL].
174    /// Note: Int2 means 2 bytes in PostgreSQL (not 2 bits).
175    /// Int2 with optional display width, e.g. INT2 or INT2(5).
176    ///
177    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
178    Int2(Option<u64>),
179    /// Unsigned Int2 with optional display width, e.g. INT2 UNSIGNED or INT2(5) UNSIGNED.
180    Int2Unsigned(Option<u64>),
181    /// Small integer with optional display width, e.g. SMALLINT or SMALLINT(5).
182    SmallInt(Option<u64>),
183    /// Unsigned small integer with optional display width,
184    /// e.g. SMALLINT UNSIGNED or SMALLINT(5) UNSIGNED.
185    SmallIntUnsigned(Option<u64>),
186    /// Unsigned small integer, e.g. USMALLINT.
187    USmallInt,
188    /// MySQL medium integer ([1]) with optional display width,
189    /// e.g. MEDIUMINT or MEDIUMINT(5).
190    ///
191    /// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
192    MediumInt(Option<u64>),
193    /// Unsigned medium integer ([1]) with optional display width,
194    /// e.g. MEDIUMINT UNSIGNED or MEDIUMINT(5) UNSIGNED.
195    ///
196    /// [1]: https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
197    MediumIntUnsigned(Option<u64>),
198    /// Int with optional display width, e.g. INT or INT(11).
199    Int(Option<u64>),
200    /// Int4 is an alias for Integer in [PostgreSQL].
201    /// Note: Int4 means 4 bytes in PostgreSQL (not 4 bits).
202    /// Int4 with optional display width, e.g. Int4 or Int4(11).
203    ///
204    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
205    Int4(Option<u64>),
206    /// Int8 is an alias for BigInt in [PostgreSQL] and Integer type in [ClickHouse].
207    /// Int8 with optional display width, e.g. INT8 or INT8(11).
208    /// Note: Int8 means 8 bytes in [PostgreSQL], but 8 bits in [ClickHouse].
209    ///
210    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
211    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
212    Int8(Option<u64>),
213    /// Integer type in [ClickHouse].
214    /// Note: Int16 means 16 bits in [ClickHouse].
215    ///
216    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
217    Int16,
218    /// Integer type in [ClickHouse].
219    /// Note: Int32 means 32 bits in [ClickHouse].
220    ///
221    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
222    Int32,
223    /// Integer type in [BigQuery], [ClickHouse].
224    ///
225    /// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#integer_types
226    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
227    Int64,
228    /// Integer type in [ClickHouse].
229    /// Note: Int128 means 128 bits in [ClickHouse].
230    ///
231    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
232    Int128,
233    /// Integer type in [ClickHouse].
234    /// Note: Int256 means 256 bits in [ClickHouse].
235    ///
236    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
237    Int256,
238    /// Integer with optional display width, e.g. INTEGER or INTEGER(11).
239    Integer(Option<u64>),
240    /// Unsigned int with optional display width, e.g. INT UNSIGNED or INT(11) UNSIGNED.
241    IntUnsigned(Option<u64>),
242    /// Unsigned int4 with optional display width, e.g. INT4 UNSIGNED or INT4(11) UNSIGNED.
243    Int4Unsigned(Option<u64>),
244    /// Unsigned integer with optional display width, e.g. INTEGER UNSIGNED or INTEGER(11) UNSIGNED.
245    IntegerUnsigned(Option<u64>),
246    /// 128-bit integer type, e.g. HUGEINT.
247    HugeInt,
248    /// Unsigned 128-bit integer type, e.g. UHUGEINT.
249    UHugeInt,
250    /// Unsigned integer type in [ClickHouse].
251    /// Note: UInt8 means 8 bits in [ClickHouse].
252    ///
253    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
254    UInt8,
255    /// Unsigned integer type in [ClickHouse].
256    /// Note: UInt16 means 16 bits in [ClickHouse].
257    ///
258    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
259    UInt16,
260    /// Unsigned integer type in [ClickHouse].
261    /// Note: UInt32 means 32 bits in [ClickHouse].
262    ///
263    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
264    UInt32,
265    /// Unsigned integer type in [ClickHouse].
266    /// Note: UInt64 means 64 bits in [ClickHouse].
267    ///
268    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
269    UInt64,
270    /// Unsigned integer type in [ClickHouse].
271    /// Note: UInt128 means 128 bits in [ClickHouse].
272    ///
273    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
274    UInt128,
275    /// Unsigned integer type in [ClickHouse].
276    /// Note: UInt256 means 256 bits in [ClickHouse].
277    ///
278    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/int-uint
279    UInt256,
280    /// Big integer with optional display width, e.g. BIGINT or BIGINT(20).
281    BigInt(Option<u64>),
282    /// Unsigned big integer with optional display width, e.g. BIGINT UNSIGNED or BIGINT(20) UNSIGNED.
283    BigIntUnsigned(Option<u64>),
284    /// Unsigned big integer, e.g. UBIGINT.
285    UBigInt,
286    /// Unsigned Int8 with optional display width, e.g. INT8 UNSIGNED or INT8(11) UNSIGNED.
287    Int8Unsigned(Option<u64>),
288    /// Signed integer as used in [MySQL CAST] target types, without optional `INTEGER` suffix,
289    /// e.g. `SIGNED`
290    ///
291    /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
292    Signed,
293    /// Signed integer as used in [MySQL CAST] target types, with optional `INTEGER` suffix,
294    /// e.g. `SIGNED INTEGER`
295    ///
296    /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
297    SignedInteger,
298    /// Signed integer as used in [MySQL CAST] target types, without optional `INTEGER` suffix,
299    /// e.g. `SIGNED`
300    ///
301    /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
302    Unsigned,
303    /// Unsigned integer as used in [MySQL CAST] target types, with optional `INTEGER` suffix,
304    /// e.g. `UNSIGNED INTEGER`.
305    ///
306    /// [MySQL CAST]: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html
307    UnsignedInteger,
308    /// Float4 is an alias for Real in [PostgreSQL].
309    ///
310    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
311    Float4,
312    /// Floating point in [ClickHouse].
313    ///
314    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/float
315    Float32,
316    /// Floating point in [BigQuery].
317    ///
318    /// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#floating_point_types
319    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/float
320    Float64,
321    /// Floating point, e.g. REAL.
322    Real,
323    /// [MySQL] unsigned real, e.g. REAL UNSIGNED.
324    /// Note: Using UNSIGNED with REAL is deprecated in recent versions of MySQL.
325    ///
326    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
327    RealUnsigned,
328    /// Float8 is an alias for Double in [PostgreSQL].
329    ///
330    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
331    Float8,
332    /// Double
333    Double(ExactNumberInfo),
334    /// [MySQL] unsigned double precision with optional precision, e.g. DOUBLE UNSIGNED or DOUBLE(10,2) UNSIGNED.
335    /// Note: Using UNSIGNED with DOUBLE is deprecated in recent versions of MySQL.
336    ///
337    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
338    DoubleUnsigned(ExactNumberInfo),
339    /// Double Precision, see [SQL Standard], [PostgreSQL].
340    ///
341    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#approximate-numeric-type
342    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype-numeric.html
343    DoublePrecision,
344    /// [MySQL] unsigned double precision, e.g. DOUBLE PRECISION UNSIGNED.
345    /// Note: Using UNSIGNED with DOUBLE PRECISION is deprecated in recent versions of MySQL.
346    ///
347    /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html
348    DoublePrecisionUnsigned,
349    /// Bool is an alias for Boolean, see [PostgreSQL].
350    ///
351    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
352    Bool,
353    /// Boolean type.
354    Boolean,
355    /// Date type.
356    Date,
357    /// Date32 with the same range as Datetime64.
358    ///
359    /// [1]: https://clickhouse.com/docs/en/sql-reference/data-types/date32
360    Date32,
361    /// Time with optional time precision and time zone information, see [SQL Standard][1].
362    ///
363    /// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#datetime-type
364    Time(Option<u64>, TimezoneInfo),
365    /// Datetime with optional time precision, see [MySQL][1].
366    ///
367    /// [1]: https://dev.mysql.com/doc/refman/8.0/en/datetime.html
368    Datetime(Option<u64>),
369    /// Datetime with time precision and optional timezone, see [ClickHouse][1].
370    ///
371    /// [1]: https://clickhouse.com/docs/en/sql-reference/data-types/datetime64
372    Datetime64(u64, Option<String>),
373    /// Timestamp with optional time precision and time zone information, see [SQL Standard][1].
374    ///
375    /// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#datetime-type
376    Timestamp(Option<u64>, TimezoneInfo),
377    /// Databricks timestamp without time zone. See [1].
378    ///
379    /// [1]: https://docs.databricks.com/aws/en/sql/language-manual/data-types/timestamp-ntz-type
380    TimestampNtz(Option<u64>),
381    /// Interval type.
382    Interval {
383        /// [PostgreSQL] fields specification like `INTERVAL YEAR TO MONTH`.
384        ///
385        /// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-datetime.html
386        fields: Option<IntervalFields>,
387        /// [PostgreSQL] subsecond precision like `INTERVAL HOUR TO SECOND(3)`
388        ///
389        /// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-datetime.html
390        precision: Option<u64>,
391    },
392    /// JSON type.
393    JSON,
394    /// Binary JSON type.
395    JSONB,
396    /// Regclass used in [PostgreSQL] serial.
397    ///
398    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
399    Regclass,
400    /// Text type.
401    Text,
402    /// [MySQL] text with up to 2**8 bytes.
403    ///
404    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
405    TinyText,
406    /// [MySQL] text with up to 2**24 bytes.
407    ///
408    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
409    MediumText,
410    /// [MySQL] text with up to 2**32 bytes.
411    ///
412    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/blob.html
413    LongText,
414    /// String with optional length.
415    String(Option<u64>),
416    /// A fixed-length string e.g [ClickHouse][1].
417    ///
418    /// [1]: https://clickhouse.com/docs/en/sql-reference/data-types/fixedstring
419    FixedString(u64),
420    /// Bytea type, see [PostgreSQL].
421    ///
422    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype-bit.html
423    Bytea,
424    /// Bit string, see [PostgreSQL], [MySQL], or [MSSQL].
425    ///
426    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype-bit.html
427    /// [MySQL]: https://dev.mysql.com/doc/refman/9.1/en/bit-type.html
428    /// [MSSQL]: https://learn.microsoft.com/en-us/sql/t-sql/data-types/bit-transact-sql?view=sql-server-ver16
429    Bit(Option<u64>),
430    /// `BIT VARYING(n)`: Variable-length bit string, see [PostgreSQL].
431    ///
432    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype-bit.html
433    BitVarying(Option<u64>),
434    /// `VARBIT(n)`: Variable-length bit string. [PostgreSQL] alias for `BIT VARYING`.
435    ///
436    /// [PostgreSQL]: https://www.postgresql.org/docs/current/datatype.html
437    VarBit(Option<u64>),
438    /// Custom types.
439    Custom(ObjectName, Vec<String>),
440    /// Arrays.
441    Array(ArrayElemTypeDef),
442    /// Map, see [ClickHouse].
443    ///
444    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/map
445    Map(Box<DataType>, Box<DataType>),
446    /// Tuple, see [ClickHouse].
447    ///
448    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/tuple
449    Tuple(Vec<StructField>),
450    /// Nested type, see [ClickHouse].
451    ///
452    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/nested-data-structures/nested
453    Nested(Vec<ColumnDef>),
454    /// Enum type.
455    Enum(Vec<EnumMember>, Option<u8>),
456    /// Set type.
457    Set(Vec<String>),
458    /// Struct type, see [Hive], [BigQuery].
459    ///
460    /// [Hive]: https://docs.cloudera.com/cdw-runtime/cloud/impala-sql-reference/topics/impala-struct.html
461    /// [BigQuery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#struct_type
462    Struct(Vec<StructField>, StructBracketKind),
463    /// Union type, see [DuckDB].
464    ///
465    /// [DuckDB]: https://duckdb.org/docs/sql/data_types/union.html
466    Union(Vec<UnionField>),
467    /// Nullable - special marker NULL represents in ClickHouse as a data type.
468    ///
469    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/nullable
470    Nullable(Box<DataType>),
471    /// LowCardinality - changes the internal representation of other data types to be dictionary-encoded.
472    ///
473    /// [ClickHouse]: https://clickhouse.com/docs/en/sql-reference/data-types/lowcardinality
474    LowCardinality(Box<DataType>),
475    /// No type specified - only used with
476    /// [`SQLiteDialect`](crate::dialect::SQLiteDialect), from statements such
477    /// as `CREATE TABLE t1 (a)`.
478    Unspecified,
479    /// Trigger data type, returned by functions associated with triggers, see [PostgreSQL].
480    ///
481    /// [PostgreSQL]: https://www.postgresql.org/docs/current/plpgsql-trigger.html
482    Trigger,
483    /// Any data type, used in BigQuery UDF definitions for templated parameters, see [BigQuery].
484    ///
485    /// [BigQuery]: https://cloud.google.com/bigquery/docs/user-defined-functions#templated-sql-udf-parameters
486    AnyType,
487    /// Geometric type, see [PostgreSQL].
488    ///
489    /// [PostgreSQL]: https://www.postgresql.org/docs/9.5/functions-geometry.html
490    GeometricType(GeometricTypeKind),
491    /// PostgreSQL text search vectors, see [PostgreSQL].
492    ///
493    /// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-textsearch.html
494    TsVector,
495    /// PostgreSQL text search query, see [PostgreSQL].
496    ///
497    /// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-textsearch.html
498    TsQuery,
499}
500
501impl fmt::Display for DataType {
502    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
503        match self {
504            DataType::Character(size) => format_character_string_type(f, "CHARACTER", size),
505            DataType::Char(size) => format_character_string_type(f, "CHAR", size),
506            DataType::CharacterVarying(size) => {
507                format_character_string_type(f, "CHARACTER VARYING", size)
508            }
509            DataType::CharVarying(size) => format_character_string_type(f, "CHAR VARYING", size),
510            DataType::Varchar(size) => format_character_string_type(f, "VARCHAR", size),
511            DataType::Nvarchar(size) => format_character_string_type(f, "NVARCHAR", size),
512            DataType::Uuid => f.write_fmt(format_args!("UUID"))write!(f, "UUID"),
513            DataType::CharacterLargeObject(size) => {
514                format_type_with_optional_length(f, "CHARACTER LARGE OBJECT", size, false)
515            }
516            DataType::CharLargeObject(size) => {
517                format_type_with_optional_length(f, "CHAR LARGE OBJECT", size, false)
518            }
519            DataType::Clob(size) => format_type_with_optional_length(f, "CLOB", size, false),
520            DataType::Binary(size) => format_type_with_optional_length(f, "BINARY", size, false),
521            DataType::Varbinary(size) => format_varbinary_type(f, "VARBINARY", size),
522            DataType::Blob(size) => format_type_with_optional_length(f, "BLOB", size, false),
523            DataType::TinyBlob => f.write_fmt(format_args!("TINYBLOB"))write!(f, "TINYBLOB"),
524            DataType::MediumBlob => f.write_fmt(format_args!("MEDIUMBLOB"))write!(f, "MEDIUMBLOB"),
525            DataType::LongBlob => f.write_fmt(format_args!("LONGBLOB"))write!(f, "LONGBLOB"),
526            DataType::Bytes(size) => format_type_with_optional_length(f, "BYTES", size, false),
527            DataType::Numeric(info) => {
528                f.write_fmt(format_args!("NUMERIC{0}", info))write!(f, "NUMERIC{info}")
529            }
530            DataType::Decimal(info) => {
531                f.write_fmt(format_args!("DECIMAL{0}", info))write!(f, "DECIMAL{info}")
532            }
533            DataType::DecimalUnsigned(info) => {
534                f.write_fmt(format_args!("DECIMAL{0} UNSIGNED", info))write!(f, "DECIMAL{info} UNSIGNED")
535            }
536            DataType::Dec(info) => {
537                f.write_fmt(format_args!("DEC{0}", info))write!(f, "DEC{info}")
538            }
539            DataType::DecUnsigned(info) => {
540                f.write_fmt(format_args!("DEC{0} UNSIGNED", info))write!(f, "DEC{info} UNSIGNED")
541            }
542            DataType::BigNumeric(info) => f.write_fmt(format_args!("BIGNUMERIC{0}", info))write!(f, "BIGNUMERIC{info}"),
543            DataType::BigDecimal(info) => f.write_fmt(format_args!("BIGDECIMAL{0}", info))write!(f, "BIGDECIMAL{info}"),
544            DataType::Float(info) => f.write_fmt(format_args!("FLOAT{0}", info))write!(f, "FLOAT{info}"),
545            DataType::FloatUnsigned(info) => f.write_fmt(format_args!("FLOAT{0} UNSIGNED", info))write!(f, "FLOAT{info} UNSIGNED"),
546            DataType::TinyInt(zerofill) => {
547                format_type_with_optional_length(f, "TINYINT", zerofill, false)
548            }
549            DataType::TinyIntUnsigned(zerofill) => {
550                format_type_with_optional_length(f, "TINYINT", zerofill, true)
551            }
552            DataType::Int2(zerofill) => {
553                format_type_with_optional_length(f, "INT2", zerofill, false)
554            }
555            DataType::Int2Unsigned(zerofill) => {
556                format_type_with_optional_length(f, "INT2", zerofill, true)
557            }
558            DataType::SmallInt(zerofill) => {
559                format_type_with_optional_length(f, "SMALLINT", zerofill, false)
560            }
561            DataType::SmallIntUnsigned(zerofill) => {
562                format_type_with_optional_length(f, "SMALLINT", zerofill, true)
563            }
564            DataType::MediumInt(zerofill) => {
565                format_type_with_optional_length(f, "MEDIUMINT", zerofill, false)
566            }
567            DataType::MediumIntUnsigned(zerofill) => {
568                format_type_with_optional_length(f, "MEDIUMINT", zerofill, true)
569            }
570            DataType::Int(zerofill) => format_type_with_optional_length(f, "INT", zerofill, false),
571            DataType::IntUnsigned(zerofill) => {
572                format_type_with_optional_length(f, "INT", zerofill, true)
573            }
574            DataType::Int4(zerofill) => {
575                format_type_with_optional_length(f, "INT4", zerofill, false)
576            }
577            DataType::Int8(zerofill) => {
578                format_type_with_optional_length(f, "INT8", zerofill, false)
579            }
580            DataType::Int16 => {
581                f.write_fmt(format_args!("Int16"))write!(f, "Int16")
582            }
583            DataType::Int32 => {
584                f.write_fmt(format_args!("Int32"))write!(f, "Int32")
585            }
586            DataType::Int64 => {
587                f.write_fmt(format_args!("INT64"))write!(f, "INT64")
588            }
589            DataType::Int128 => {
590                f.write_fmt(format_args!("Int128"))write!(f, "Int128")
591            }
592            DataType::Int256 => {
593                f.write_fmt(format_args!("Int256"))write!(f, "Int256")
594            }
595            DataType::HugeInt => {
596                f.write_fmt(format_args!("HUGEINT"))write!(f, "HUGEINT")
597            }
598            DataType::Int4Unsigned(zerofill) => {
599                format_type_with_optional_length(f, "INT4", zerofill, true)
600            }
601            DataType::Integer(zerofill) => {
602                format_type_with_optional_length(f, "INTEGER", zerofill, false)
603            }
604            DataType::IntegerUnsigned(zerofill) => {
605                format_type_with_optional_length(f, "INTEGER", zerofill, true)
606            }
607            DataType::BigInt(zerofill) => {
608                format_type_with_optional_length(f, "BIGINT", zerofill, false)
609            }
610            DataType::BigIntUnsigned(zerofill) => {
611                format_type_with_optional_length(f, "BIGINT", zerofill, true)
612            }
613            DataType::Int8Unsigned(zerofill) => {
614                format_type_with_optional_length(f, "INT8", zerofill, true)
615            }
616            DataType::UTinyInt => {
617                f.write_fmt(format_args!("UTINYINT"))write!(f, "UTINYINT")
618            }
619            DataType::USmallInt => {
620                f.write_fmt(format_args!("USMALLINT"))write!(f, "USMALLINT")
621            }
622            DataType::UBigInt => {
623                f.write_fmt(format_args!("UBIGINT"))write!(f, "UBIGINT")
624            }
625            DataType::UHugeInt => {
626                f.write_fmt(format_args!("UHUGEINT"))write!(f, "UHUGEINT")
627            }
628            DataType::UInt8 => {
629                f.write_fmt(format_args!("UInt8"))write!(f, "UInt8")
630            }
631            DataType::UInt16 => {
632                f.write_fmt(format_args!("UInt16"))write!(f, "UInt16")
633            }
634            DataType::UInt32 => {
635                f.write_fmt(format_args!("UInt32"))write!(f, "UInt32")
636            }
637            DataType::UInt64 => {
638                f.write_fmt(format_args!("UInt64"))write!(f, "UInt64")
639            }
640            DataType::UInt128 => {
641                f.write_fmt(format_args!("UInt128"))write!(f, "UInt128")
642            }
643            DataType::UInt256 => {
644                f.write_fmt(format_args!("UInt256"))write!(f, "UInt256")
645            }
646            DataType::Signed => {
647                f.write_fmt(format_args!("SIGNED"))write!(f, "SIGNED")
648            }
649            DataType::SignedInteger => {
650                f.write_fmt(format_args!("SIGNED INTEGER"))write!(f, "SIGNED INTEGER")
651            }
652            DataType::Unsigned => {
653                f.write_fmt(format_args!("UNSIGNED"))write!(f, "UNSIGNED")
654            }
655            DataType::UnsignedInteger => {
656                f.write_fmt(format_args!("UNSIGNED INTEGER"))write!(f, "UNSIGNED INTEGER")
657            }
658            DataType::Real => f.write_fmt(format_args!("REAL"))write!(f, "REAL"),
659            DataType::RealUnsigned => f.write_fmt(format_args!("REAL UNSIGNED"))write!(f, "REAL UNSIGNED"),
660            DataType::Float4 => f.write_fmt(format_args!("FLOAT4"))write!(f, "FLOAT4"),
661            DataType::Float32 => f.write_fmt(format_args!("Float32"))write!(f, "Float32"),
662            DataType::Float64 => f.write_fmt(format_args!("FLOAT64"))write!(f, "FLOAT64"),
663            DataType::Double(info) => f.write_fmt(format_args!("DOUBLE{0}", info))write!(f, "DOUBLE{info}"),
664            DataType::DoubleUnsigned(info) => f.write_fmt(format_args!("DOUBLE{0} UNSIGNED", info))write!(f, "DOUBLE{info} UNSIGNED"),
665            DataType::Float8 => f.write_fmt(format_args!("FLOAT8"))write!(f, "FLOAT8"),
666            DataType::DoublePrecision => f.write_fmt(format_args!("DOUBLE PRECISION"))write!(f, "DOUBLE PRECISION"),
667            DataType::DoublePrecisionUnsigned => f.write_fmt(format_args!("DOUBLE PRECISION UNSIGNED"))write!(f, "DOUBLE PRECISION UNSIGNED"),
668            DataType::Bool => f.write_fmt(format_args!("BOOL"))write!(f, "BOOL"),
669            DataType::Boolean => f.write_fmt(format_args!("BOOLEAN"))write!(f, "BOOLEAN"),
670            DataType::Date => f.write_fmt(format_args!("DATE"))write!(f, "DATE"),
671            DataType::Date32 => f.write_fmt(format_args!("Date32"))write!(f, "Date32"),
672            DataType::Time(precision, timezone_info) => {
673                format_datetime_precision_and_tz(f, "TIME", precision, timezone_info)
674            }
675            DataType::Datetime(precision) => {
676                format_type_with_optional_length(f, "DATETIME", precision, false)
677            }
678            DataType::Timestamp(precision, timezone_info) => {
679                format_datetime_precision_and_tz(f, "TIMESTAMP", precision, timezone_info)
680            }
681            DataType::TimestampNtz(precision) => {
682                format_type_with_optional_length(f, "TIMESTAMP_NTZ", precision, false)
683            }
684            DataType::Datetime64(precision, timezone) => {
685                format_clickhouse_datetime_precision_and_timezone(
686                    f,
687                    "DateTime64",
688                    precision,
689                    timezone,
690                )
691            }
692            DataType::Interval { fields, precision } => {
693                f.write_fmt(format_args!("INTERVAL"))write!(f, "INTERVAL")?;
694                if let Some(fields) = fields {
695                    f.write_fmt(format_args!(" {0}", fields))write!(f, " {fields}")?;
696                }
697                if let Some(precision) = precision {
698                    f.write_fmt(format_args!("({0})", precision))write!(f, "({precision})")?;
699                }
700                Ok(())
701            }
702            DataType::JSON => f.write_fmt(format_args!("JSON"))write!(f, "JSON"),
703            DataType::JSONB => f.write_fmt(format_args!("JSONB"))write!(f, "JSONB"),
704            DataType::Regclass => f.write_fmt(format_args!("REGCLASS"))write!(f, "REGCLASS"),
705            DataType::Text => f.write_fmt(format_args!("TEXT"))write!(f, "TEXT"),
706            DataType::TinyText => f.write_fmt(format_args!("TINYTEXT"))write!(f, "TINYTEXT"),
707            DataType::MediumText => f.write_fmt(format_args!("MEDIUMTEXT"))write!(f, "MEDIUMTEXT"),
708            DataType::LongText => f.write_fmt(format_args!("LONGTEXT"))write!(f, "LONGTEXT"),
709            DataType::String(size) => format_type_with_optional_length(f, "STRING", size, false),
710            DataType::Bytea => f.write_fmt(format_args!("BYTEA"))write!(f, "BYTEA"),
711            DataType::Bit(size) => format_type_with_optional_length(f, "BIT", size, false),
712            DataType::BitVarying(size) => {
713                format_type_with_optional_length(f, "BIT VARYING", size, false)
714            }
715            DataType::VarBit(size) => format_type_with_optional_length(f, "VARBIT", size, false),
716            DataType::Array(ty) => match ty {
717                ArrayElemTypeDef::None => f.write_fmt(format_args!("ARRAY"))write!(f, "ARRAY"),
718                ArrayElemTypeDef::SquareBracket(t, None) => f.write_fmt(format_args!("{0}[]", t))write!(f, "{t}[]"),
719                ArrayElemTypeDef::SquareBracket(t, Some(size)) => f.write_fmt(format_args!("{0}[{1}]", t, size))write!(f, "{t}[{size}]"),
720                ArrayElemTypeDef::AngleBracket(t) => f.write_fmt(format_args!("ARRAY<{0}>", t))write!(f, "ARRAY<{t}>"),
721                ArrayElemTypeDef::Parenthesis(t) => f.write_fmt(format_args!("Array({0})", t))write!(f, "Array({t})"),
722            },
723            DataType::Custom(ty, modifiers) => {
724                if modifiers.is_empty() {
725                    f.write_fmt(format_args!("{0}", ty))write!(f, "{ty}")
726                } else {
727                    f.write_fmt(format_args!("{0}({1})", ty, modifiers.join(", ")))write!(f, "{}({})", ty, modifiers.join(", "))
728                }
729            }
730            DataType::Enum(vals, bits) => {
731                match bits {
732                    Some(bits) => f.write_fmt(format_args!("ENUM{0}", bits))write!(f, "ENUM{bits}"),
733                    None => f.write_fmt(format_args!("ENUM"))write!(f, "ENUM"),
734                }?;
735                f.write_fmt(format_args!("("))write!(f, "(")?;
736                for (i, v) in vals.iter().enumerate() {
737                    if i != 0 {
738                        f.write_fmt(format_args!(", "))write!(f, ", ")?;
739                    }
740                    match v {
741                        EnumMember::Name(name) => {
742                            f.write_fmt(format_args!("\'{0}\'", escape_single_quote_string(name)))write!(f, "'{}'", escape_single_quote_string(name))?
743                        }
744                        EnumMember::NamedValue(name, value) => {
745                            f.write_fmt(format_args!("\'{0}\' = {1}", escape_single_quote_string(name),
        value))write!(f, "'{}' = {}", escape_single_quote_string(name), value)?
746                        }
747                    }
748                }
749                f.write_fmt(format_args!(")"))write!(f, ")")
750            }
751            DataType::Set(vals) => {
752                f.write_fmt(format_args!("SET("))write!(f, "SET(")?;
753                for (i, v) in vals.iter().enumerate() {
754                    if i != 0 {
755                        f.write_fmt(format_args!(", "))write!(f, ", ")?;
756                    }
757                    f.write_fmt(format_args!("\'{0}\'", escape_single_quote_string(v)))write!(f, "'{}'", escape_single_quote_string(v))?;
758                }
759                f.write_fmt(format_args!(")"))write!(f, ")")
760            }
761            DataType::Struct(fields, bracket) => {
762                if !fields.is_empty() {
763                    match bracket {
764                        StructBracketKind::Parentheses => {
765                            f.write_fmt(format_args!("STRUCT({0})", display_comma_separated(fields)))write!(f, "STRUCT({})", display_comma_separated(fields))
766                        }
767                        StructBracketKind::AngleBrackets => {
768                            f.write_fmt(format_args!("STRUCT<{0}>", display_comma_separated(fields)))write!(f, "STRUCT<{}>", display_comma_separated(fields))
769                        }
770                    }
771                } else {
772                    f.write_fmt(format_args!("STRUCT"))write!(f, "STRUCT")
773                }
774            }
775            DataType::Union(fields) => {
776                f.write_fmt(format_args!("UNION({0})", display_comma_separated(fields)))write!(f, "UNION({})", display_comma_separated(fields))
777            }
778            // ClickHouse
779            DataType::Nullable(data_type) => {
780                f.write_fmt(format_args!("Nullable({0})", data_type))write!(f, "Nullable({data_type})")
781            }
782            DataType::FixedString(character_length) => {
783                f.write_fmt(format_args!("FixedString({0})", character_length))write!(f, "FixedString({character_length})")
784            }
785            DataType::LowCardinality(data_type) => {
786                f.write_fmt(format_args!("LowCardinality({0})", data_type))write!(f, "LowCardinality({data_type})")
787            }
788            DataType::Map(key_data_type, value_data_type) => {
789                f.write_fmt(format_args!("Map({0}, {1})", key_data_type, value_data_type))write!(f, "Map({key_data_type}, {value_data_type})")
790            }
791            DataType::Tuple(fields) => {
792                f.write_fmt(format_args!("Tuple({0})", display_comma_separated(fields)))write!(f, "Tuple({})", display_comma_separated(fields))
793            }
794            DataType::Nested(fields) => {
795                f.write_fmt(format_args!("Nested({0})", display_comma_separated(fields)))write!(f, "Nested({})", display_comma_separated(fields))
796            }
797            DataType::Unspecified => Ok(()),
798            DataType::Trigger => f.write_fmt(format_args!("TRIGGER"))write!(f, "TRIGGER"),
799            DataType::AnyType => f.write_fmt(format_args!("ANY TYPE"))write!(f, "ANY TYPE"),
800            DataType::Table(fields) => match fields {
801                Some(fields) => {
802                    f.write_fmt(format_args!("TABLE({0})", display_comma_separated(fields)))write!(f, "TABLE({})", display_comma_separated(fields))
803                }
804                None => {
805                    f.write_fmt(format_args!("TABLE"))write!(f, "TABLE")
806                }
807            },
808            DataType::NamedTable { name, columns } => {
809                f.write_fmt(format_args!("{0} TABLE ({1})", name,
        display_comma_separated(columns)))write!(f, "{} TABLE ({})", name, display_comma_separated(columns))
810            }
811            DataType::GeometricType(kind) => f.write_fmt(format_args!("{0}", kind))write!(f, "{kind}"),
812            DataType::TsVector => f.write_fmt(format_args!("TSVECTOR"))write!(f, "TSVECTOR"),
813            DataType::TsQuery => f.write_fmt(format_args!("TSQUERY"))write!(f, "TSQUERY"),
814        }
815    }
816}
817
818fn format_type_with_optional_length(
819    f: &mut fmt::Formatter,
820    sql_type: &'static str,
821    len: &Option<u64>,
822    unsigned: bool,
823) -> fmt::Result {
824    f.write_fmt(format_args!("{0}", sql_type))write!(f, "{sql_type}")?;
825    if let Some(len) = len {
826        f.write_fmt(format_args!("({0})", len))write!(f, "({len})")?;
827    }
828    if unsigned {
829        f.write_fmt(format_args!(" UNSIGNED"))write!(f, " UNSIGNED")?;
830    }
831    Ok(())
832}
833
834fn format_character_string_type(
835    f: &mut fmt::Formatter,
836    sql_type: &str,
837    size: &Option<CharacterLength>,
838) -> fmt::Result {
839    f.write_fmt(format_args!("{0}", sql_type))write!(f, "{sql_type}")?;
840    if let Some(size) = size {
841        f.write_fmt(format_args!("({0})", size))write!(f, "({size})")?;
842    }
843    Ok(())
844}
845
846fn format_varbinary_type(
847    f: &mut fmt::Formatter,
848    sql_type: &str,
849    size: &Option<BinaryLength>,
850) -> fmt::Result {
851    f.write_fmt(format_args!("{0}", sql_type))write!(f, "{sql_type}")?;
852    if let Some(size) = size {
853        f.write_fmt(format_args!("({0})", size))write!(f, "({size})")?;
854    }
855    Ok(())
856}
857
858fn format_datetime_precision_and_tz(
859    f: &mut fmt::Formatter,
860    sql_type: &'static str,
861    len: &Option<u64>,
862    time_zone: &TimezoneInfo,
863) -> fmt::Result {
864    f.write_fmt(format_args!("{0}", sql_type))write!(f, "{sql_type}")?;
865    let len_fmt = len.as_ref().map(|l| ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("({0})", l))
    })format!("({l})")).unwrap_or_default();
866
867    match time_zone {
868        TimezoneInfo::Tz => {
869            f.write_fmt(format_args!("{0}{1}", time_zone, len_fmt))write!(f, "{time_zone}{len_fmt}")?;
870        }
871        _ => {
872            f.write_fmt(format_args!("{0}{1}", len_fmt, time_zone))write!(f, "{len_fmt}{time_zone}")?;
873        }
874    }
875
876    Ok(())
877}
878
879fn format_clickhouse_datetime_precision_and_timezone(
880    f: &mut fmt::Formatter,
881    sql_type: &'static str,
882    len: &u64,
883    time_zone: &Option<String>,
884) -> fmt::Result {
885    f.write_fmt(format_args!("{0}({1}", sql_type, len))write!(f, "{sql_type}({len}")?;
886
887    if let Some(time_zone) = time_zone {
888        f.write_fmt(format_args!(", \'{0}\'", time_zone))write!(f, ", '{time_zone}'")?;
889    }
890
891    f.write_fmt(format_args!(")"))write!(f, ")")?;
892
893    Ok(())
894}
895
896/// Type of brackets used for `STRUCT` literals.
897#[derive(#[automatically_derived]
impl ::core::fmt::Debug for StructBracketKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                StructBracketKind::Parentheses => "Parentheses",
                StructBracketKind::AngleBrackets => "AngleBrackets",
            })
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for StructBracketKind {
    #[inline]
    fn clone(&self) -> StructBracketKind { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for StructBracketKind { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for StructBracketKind {
    #[inline]
    fn eq(&self, other: &StructBracketKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for StructBracketKind {
    #[inline]
    fn partial_cmp(&self, other: &StructBracketKind)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for StructBracketKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for StructBracketKind {
    #[inline]
    fn cmp(&self, other: &StructBracketKind) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for StructBracketKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash)]
898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
899#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for StructBracketKind {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Parentheses => {}
                            Self::AngleBrackets => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for StructBracketKind {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Parentheses => {}
                            Self::AngleBrackets => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
900pub enum StructBracketKind {
901    /// Example: `STRUCT(a INT, b STRING)`
902    Parentheses,
903    /// Example: `STRUCT<a INT, b STRING>`
904    AngleBrackets,
905}
906
907/// Timestamp and Time data types information about TimeZone formatting.
908///
909/// This is more related to a display information than real differences between each variant. To
910/// guarantee compatibility with the input query we must maintain its exact information.
911#[derive(#[automatically_derived]
impl ::core::fmt::Debug for TimezoneInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                TimezoneInfo::None => "None",
                TimezoneInfo::WithTimeZone => "WithTimeZone",
                TimezoneInfo::WithoutTimeZone => "WithoutTimeZone",
                TimezoneInfo::Tz => "Tz",
            })
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for TimezoneInfo { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TimezoneInfo {
    #[inline]
    fn clone(&self) -> TimezoneInfo { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for TimezoneInfo {
    #[inline]
    fn eq(&self, other: &TimezoneInfo) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for TimezoneInfo {
    #[inline]
    fn partial_cmp(&self, other: &TimezoneInfo)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for TimezoneInfo {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for TimezoneInfo {
    #[inline]
    fn cmp(&self, other: &TimezoneInfo) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for TimezoneInfo {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash)]
912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
913#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for TimezoneInfo {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::WithTimeZone => {}
                            Self::WithoutTimeZone => {}
                            Self::Tz => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for TimezoneInfo {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::WithTimeZone => {}
                            Self::WithoutTimeZone => {}
                            Self::Tz => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
914pub enum TimezoneInfo {
915    /// No information about time zone, e.g. TIMESTAMP
916    None,
917    /// Temporal type 'WITH TIME ZONE', e.g. TIMESTAMP WITH TIME ZONE, [SQL Standard], [Oracle]
918    ///
919    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#datetime-type
920    /// [Oracle]: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/nlspg/datetime-data-types-and-time-zone-support.html#GUID-3F1C388E-C651-43D5-ADBC-1A49E5C2CA05
921    WithTimeZone,
922    /// Temporal type 'WITHOUT TIME ZONE', e.g. TIME WITHOUT TIME ZONE, [SQL Standard], [Postgresql]
923    ///
924    /// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#datetime-type
925    /// [Postgresql]: https://www.postgresql.org/docs/current/datatype-datetime.html
926    WithoutTimeZone,
927    /// Postgresql specific `WITH TIME ZONE` formatting, for both TIME and TIMESTAMP, e.g. TIMETZ, [Postgresql]
928    ///
929    /// [Postgresql]: https://www.postgresql.org/docs/current/datatype-datetime.html
930    Tz,
931}
932
933impl fmt::Display for TimezoneInfo {
934    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
935        match self {
936            TimezoneInfo::None => {
937                f.write_fmt(format_args!(""))write!(f, "")
938            }
939            TimezoneInfo::WithTimeZone => {
940                f.write_fmt(format_args!(" WITH TIME ZONE"))write!(f, " WITH TIME ZONE")
941            }
942            TimezoneInfo::WithoutTimeZone => {
943                f.write_fmt(format_args!(" WITHOUT TIME ZONE"))write!(f, " WITHOUT TIME ZONE")
944            }
945            TimezoneInfo::Tz => {
946                // TZ is the only one that is displayed BEFORE the precision, so the datatype display
947                // must be aware of that. Check <https://www.postgresql.org/docs/14/datatype-datetime.html>
948                // for more information
949                f.write_fmt(format_args!("TZ"))write!(f, "TZ")
950            }
951        }
952    }
953}
954
955/// Fields for [Postgres] `INTERVAL` type.
956///
957/// [Postgres]: https://www.postgresql.org/docs/17/datatype-datetime.html
958#[derive(#[automatically_derived]
impl ::core::fmt::Debug for IntervalFields {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                IntervalFields::Year => "Year",
                IntervalFields::Month => "Month",
                IntervalFields::Day => "Day",
                IntervalFields::Hour => "Hour",
                IntervalFields::Minute => "Minute",
                IntervalFields::Second => "Second",
                IntervalFields::YearToMonth => "YearToMonth",
                IntervalFields::DayToHour => "DayToHour",
                IntervalFields::DayToMinute => "DayToMinute",
                IntervalFields::DayToSecond => "DayToSecond",
                IntervalFields::HourToMinute => "HourToMinute",
                IntervalFields::HourToSecond => "HourToSecond",
                IntervalFields::MinuteToSecond => "MinuteToSecond",
            })
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for IntervalFields { }Copy, #[automatically_derived]
impl ::core::clone::Clone for IntervalFields {
    #[inline]
    fn clone(&self) -> IntervalFields { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for IntervalFields {
    #[inline]
    fn eq(&self, other: &IntervalFields) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for IntervalFields {
    #[inline]
    fn partial_cmp(&self, other: &IntervalFields)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for IntervalFields {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for IntervalFields {
    #[inline]
    fn cmp(&self, other: &IntervalFields) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for IntervalFields {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash)]
959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
960#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for IntervalFields {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Year => {}
                            Self::Month => {}
                            Self::Day => {}
                            Self::Hour => {}
                            Self::Minute => {}
                            Self::Second => {}
                            Self::YearToMonth => {}
                            Self::DayToHour => {}
                            Self::DayToMinute => {}
                            Self::DayToSecond => {}
                            Self::HourToMinute => {}
                            Self::HourToSecond => {}
                            Self::MinuteToSecond => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for IntervalFields {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Year => {}
                            Self::Month => {}
                            Self::Day => {}
                            Self::Hour => {}
                            Self::Minute => {}
                            Self::Second => {}
                            Self::YearToMonth => {}
                            Self::DayToHour => {}
                            Self::DayToMinute => {}
                            Self::DayToSecond => {}
                            Self::HourToMinute => {}
                            Self::HourToSecond => {}
                            Self::MinuteToSecond => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
961pub enum IntervalFields {
962    /// `YEAR` field
963    Year,
964    /// `MONTH` field
965    Month,
966    /// `DAY` field
967    Day,
968    /// `HOUR` field
969    Hour,
970    /// `MINUTE` field
971    Minute,
972    /// `SECOND` field
973    Second,
974    /// `YEAR TO MONTH` field
975    YearToMonth,
976    /// `DAY TO HOUR` field
977    DayToHour,
978    /// `DAY TO MINUTE` field
979    DayToMinute,
980    /// `DAY TO SECOND` field
981    DayToSecond,
982    /// `HOUR TO MINUTE` field
983    HourToMinute,
984    /// `HOUR TO SECOND` field
985    HourToSecond,
986    /// `MINUTE TO SECOND` field
987    MinuteToSecond,
988}
989
990impl fmt::Display for IntervalFields {
991    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
992        match self {
993            IntervalFields::Year => f.write_fmt(format_args!("YEAR"))write!(f, "YEAR"),
994            IntervalFields::Month => f.write_fmt(format_args!("MONTH"))write!(f, "MONTH"),
995            IntervalFields::Day => f.write_fmt(format_args!("DAY"))write!(f, "DAY"),
996            IntervalFields::Hour => f.write_fmt(format_args!("HOUR"))write!(f, "HOUR"),
997            IntervalFields::Minute => f.write_fmt(format_args!("MINUTE"))write!(f, "MINUTE"),
998            IntervalFields::Second => f.write_fmt(format_args!("SECOND"))write!(f, "SECOND"),
999            IntervalFields::YearToMonth => f.write_fmt(format_args!("YEAR TO MONTH"))write!(f, "YEAR TO MONTH"),
1000            IntervalFields::DayToHour => f.write_fmt(format_args!("DAY TO HOUR"))write!(f, "DAY TO HOUR"),
1001            IntervalFields::DayToMinute => f.write_fmt(format_args!("DAY TO MINUTE"))write!(f, "DAY TO MINUTE"),
1002            IntervalFields::DayToSecond => f.write_fmt(format_args!("DAY TO SECOND"))write!(f, "DAY TO SECOND"),
1003            IntervalFields::HourToMinute => f.write_fmt(format_args!("HOUR TO MINUTE"))write!(f, "HOUR TO MINUTE"),
1004            IntervalFields::HourToSecond => f.write_fmt(format_args!("HOUR TO SECOND"))write!(f, "HOUR TO SECOND"),
1005            IntervalFields::MinuteToSecond => f.write_fmt(format_args!("MINUTE TO SECOND"))write!(f, "MINUTE TO SECOND"),
1006        }
1007    }
1008}
1009
1010/// Additional information for `NUMERIC`, `DECIMAL`, and `DEC` data types
1011/// following the 2016 [SQL Standard].
1012///
1013/// [SQL Standard]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#exact-numeric-type
1014#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ExactNumberInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            ExactNumberInfo::None =>
                ::core::fmt::Formatter::write_str(f, "None"),
            ExactNumberInfo::Precision(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Precision", &__self_0),
            ExactNumberInfo::PrecisionAndScale(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "PrecisionAndScale", __self_0, &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for ExactNumberInfo { }Copy, #[automatically_derived]
impl ::core::clone::Clone for ExactNumberInfo {
    #[inline]
    fn clone(&self) -> ExactNumberInfo {
        let _: ::core::clone::AssertParamIsClone<u64>;
        let _: ::core::clone::AssertParamIsClone<i64>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for ExactNumberInfo {
    #[inline]
    fn eq(&self, other: &ExactNumberInfo) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (ExactNumberInfo::Precision(__self_0),
                    ExactNumberInfo::Precision(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ExactNumberInfo::PrecisionAndScale(__self_0, __self_1),
                    ExactNumberInfo::PrecisionAndScale(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for ExactNumberInfo {
    #[inline]
    fn partial_cmp(&self, other: &ExactNumberInfo)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (ExactNumberInfo::Precision(__self_0),
                ExactNumberInfo::Precision(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (ExactNumberInfo::PrecisionAndScale(__self_0, __self_1),
                ExactNumberInfo::PrecisionAndScale(__arg1_0, __arg1_1)) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                    cmp => cmp,
                },
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for ExactNumberInfo {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u64>;
        let _: ::core::cmp::AssertParamIsEq<i64>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for ExactNumberInfo {
    #[inline]
    fn cmp(&self, other: &ExactNumberInfo) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (ExactNumberInfo::Precision(__self_0),
                        ExactNumberInfo::Precision(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (ExactNumberInfo::PrecisionAndScale(__self_0, __self_1),
                        ExactNumberInfo::PrecisionAndScale(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for ExactNumberInfo {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            ExactNumberInfo::Precision(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            ExactNumberInfo::PrecisionAndScale(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            _ => {}
        }
    }
}Hash)]
1015#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1016#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for ExactNumberInfo {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::Precision(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::PrecisionAndScale(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for ExactNumberInfo {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::Precision(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::PrecisionAndScale(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1017pub enum ExactNumberInfo {
1018    /// No additional information, e.g. `DECIMAL`.
1019    None,
1020    /// Only precision information, e.g. `DECIMAL(10)`.
1021    Precision(u64),
1022    /// Precision and scale information, e.g. `DECIMAL(10,2)`.
1023    PrecisionAndScale(u64, i64),
1024}
1025
1026impl fmt::Display for ExactNumberInfo {
1027    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1028        match self {
1029            ExactNumberInfo::None => {
1030                f.write_fmt(format_args!(""))write!(f, "")
1031            }
1032            ExactNumberInfo::Precision(p) => {
1033                f.write_fmt(format_args!("({0})", p))write!(f, "({p})")
1034            }
1035            ExactNumberInfo::PrecisionAndScale(p, s) => {
1036                f.write_fmt(format_args!("({0},{1})", p, s))write!(f, "({p},{s})")
1037            }
1038        }
1039    }
1040}
1041
1042/// Information about [character length][1], including length and possibly unit.
1043///
1044/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#character-length
1045#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CharacterLength {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            CharacterLength::IntegerLength { length: __self_0, unit: __self_1
                } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "IntegerLength", "length", __self_0, "unit", &__self_1),
            CharacterLength::Max =>
                ::core::fmt::Formatter::write_str(f, "Max"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for CharacterLength { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CharacterLength {
    #[inline]
    fn clone(&self) -> CharacterLength {
        let _: ::core::clone::AssertParamIsClone<u64>;
        let _: ::core::clone::AssertParamIsClone<Option<CharLengthUnits>>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CharacterLength {
    #[inline]
    fn eq(&self, other: &CharacterLength) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CharacterLength::IntegerLength {
                    length: __self_0, unit: __self_1 },
                    CharacterLength::IntegerLength {
                    length: __arg1_0, unit: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for CharacterLength {
    #[inline]
    fn partial_cmp(&self, other: &CharacterLength)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (CharacterLength::IntegerLength { length: __self_0, unit: __self_1
                }, CharacterLength::IntegerLength {
                length: __arg1_0, unit: __arg1_1 }) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                    cmp => cmp,
                },
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for CharacterLength {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u64>;
        let _: ::core::cmp::AssertParamIsEq<Option<CharLengthUnits>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for CharacterLength {
    #[inline]
    fn cmp(&self, other: &CharacterLength) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (CharacterLength::IntegerLength {
                        length: __self_0, unit: __self_1 },
                        CharacterLength::IntegerLength {
                        length: __arg1_0, unit: __arg1_1 }) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for CharacterLength {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CharacterLength::IntegerLength { length: __self_0, unit: __self_1
                } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            _ => {}
        }
    }
}Hash)]
1046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1047#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for CharacterLength {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::IntegerLength { length, unit } => {
                                sqlparser::ast::Visit::visit(length, visitor)?;
                                sqlparser::ast::Visit::visit(unit, visitor)?;
                            }
                            Self::Max => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for CharacterLength {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::IntegerLength { length, unit } => {
                                sqlparser::ast::VisitMut::visit(length, visitor)?;
                                sqlparser::ast::VisitMut::visit(unit, visitor)?;
                            }
                            Self::Max => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1048pub enum CharacterLength {
1049    /// Integer length with optional unit (e.g. `CHAR(10)` or `VARCHAR(10 CHARACTERS)`).
1050    IntegerLength {
1051        /// Default (if VARYING) or maximum (if not VARYING) length
1052        length: u64,
1053        /// Optional unit. If not informed, the ANSI handles it as CHARACTERS implicitly
1054        unit: Option<CharLengthUnits>,
1055    },
1056    /// VARCHAR(MAX) or NVARCHAR(MAX), used in T-SQL (Microsoft SQL Server).
1057    Max,
1058}
1059
1060impl fmt::Display for CharacterLength {
1061    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1062        match self {
1063            CharacterLength::IntegerLength { length, unit } => {
1064                f.write_fmt(format_args!("{0}", length))write!(f, "{length}")?;
1065                if let Some(unit) = unit {
1066                    f.write_fmt(format_args!(" {0}", unit))write!(f, " {unit}")?;
1067                }
1068            }
1069            CharacterLength::Max => {
1070                f.write_fmt(format_args!("MAX"))write!(f, "MAX")?;
1071            }
1072        }
1073        Ok(())
1074    }
1075}
1076
1077/// Possible units for characters, initially based on 2016 ANSI [SQL Standard][1].
1078///
1079/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#char-length-units
1080#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CharLengthUnits {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                CharLengthUnits::Characters => "Characters",
                CharLengthUnits::Octets => "Octets",
            })
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for CharLengthUnits { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CharLengthUnits {
    #[inline]
    fn clone(&self) -> CharLengthUnits { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CharLengthUnits {
    #[inline]
    fn eq(&self, other: &CharLengthUnits) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for CharLengthUnits {
    #[inline]
    fn partial_cmp(&self, other: &CharLengthUnits)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for CharLengthUnits {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for CharLengthUnits {
    #[inline]
    fn cmp(&self, other: &CharLengthUnits) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for CharLengthUnits {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash)]
1081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1082#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for CharLengthUnits {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self { Self::Characters => {} Self::Octets => {} }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for CharLengthUnits {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self { Self::Characters => {} Self::Octets => {} }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1083pub enum CharLengthUnits {
1084    /// CHARACTERS unit
1085    Characters,
1086    /// OCTETS unit
1087    Octets,
1088}
1089
1090impl fmt::Display for CharLengthUnits {
1091    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1092        match self {
1093            Self::Characters => {
1094                f.write_fmt(format_args!("CHARACTERS"))write!(f, "CHARACTERS")
1095            }
1096            Self::Octets => {
1097                f.write_fmt(format_args!("OCTETS"))write!(f, "OCTETS")
1098            }
1099        }
1100    }
1101}
1102
1103#[derive(#[automatically_derived]
impl ::core::fmt::Debug for BinaryLength {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            BinaryLength::IntegerLength { length: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "IntegerLength", "length", &__self_0),
            BinaryLength::Max => ::core::fmt::Formatter::write_str(f, "Max"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for BinaryLength { }Copy, #[automatically_derived]
impl ::core::clone::Clone for BinaryLength {
    #[inline]
    fn clone(&self) -> BinaryLength {
        let _: ::core::clone::AssertParamIsClone<u64>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for BinaryLength {
    #[inline]
    fn eq(&self, other: &BinaryLength) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (BinaryLength::IntegerLength { length: __self_0 },
                    BinaryLength::IntegerLength { length: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for BinaryLength {
    #[inline]
    fn partial_cmp(&self, other: &BinaryLength)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (BinaryLength::IntegerLength { length: __self_0 },
                BinaryLength::IntegerLength { length: __arg1_0 }) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for BinaryLength {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u64>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for BinaryLength {
    #[inline]
    fn cmp(&self, other: &BinaryLength) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (BinaryLength::IntegerLength { length: __self_0 },
                        BinaryLength::IntegerLength { length: __arg1_0 }) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for BinaryLength {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            BinaryLength::IntegerLength { length: __self_0 } =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for BinaryLength {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::IntegerLength { length } => {
                                sqlparser::ast::Visit::visit(length, visitor)?;
                            }
                            Self::Max => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for BinaryLength {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::IntegerLength { length } => {
                                sqlparser::ast::VisitMut::visit(length, visitor)?;
                            }
                            Self::Max => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1106/// Information about [binary length][1], including length and possibly unit.
1107///
1108/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#binary-length
1109pub enum BinaryLength {
1110    /// Integer length for binary types (e.g. `VARBINARY(100)`).
1111    IntegerLength {
1112        /// Default (if VARYING)
1113        length: u64,
1114    },
1115    /// VARBINARY(MAX) used in T-SQL (Microsoft SQL Server).
1116    Max,
1117}
1118
1119impl fmt::Display for BinaryLength {
1120    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1121        match self {
1122            BinaryLength::IntegerLength { length } => {
1123                f.write_fmt(format_args!("{0}", length))write!(f, "{length}")?;
1124            }
1125            BinaryLength::Max => {
1126                f.write_fmt(format_args!("MAX"))write!(f, "MAX")?;
1127            }
1128        }
1129        Ok(())
1130    }
1131}
1132
1133/// Represents the data type of the elements in an array (if any) as well as
1134/// the syntax used to declare the array.
1135///
1136/// For example: Bigquery/Hive use `ARRAY<INT>` whereas snowflake uses ARRAY.
1137#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ArrayElemTypeDef {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            ArrayElemTypeDef::None =>
                ::core::fmt::Formatter::write_str(f, "None"),
            ArrayElemTypeDef::AngleBracket(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AngleBracket", &__self_0),
            ArrayElemTypeDef::SquareBracket(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "SquareBracket", __self_0, &__self_1),
            ArrayElemTypeDef::Parenthesis(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Parenthesis", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for ArrayElemTypeDef {
    #[inline]
    fn clone(&self) -> ArrayElemTypeDef {
        match self {
            ArrayElemTypeDef::None => ArrayElemTypeDef::None,
            ArrayElemTypeDef::AngleBracket(__self_0) =>
                ArrayElemTypeDef::AngleBracket(::core::clone::Clone::clone(__self_0)),
            ArrayElemTypeDef::SquareBracket(__self_0, __self_1) =>
                ArrayElemTypeDef::SquareBracket(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ArrayElemTypeDef::Parenthesis(__self_0) =>
                ArrayElemTypeDef::Parenthesis(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for ArrayElemTypeDef {
    #[inline]
    fn eq(&self, other: &ArrayElemTypeDef) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (ArrayElemTypeDef::AngleBracket(__self_0),
                    ArrayElemTypeDef::AngleBracket(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ArrayElemTypeDef::SquareBracket(__self_0, __self_1),
                    ArrayElemTypeDef::SquareBracket(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ArrayElemTypeDef::Parenthesis(__self_0),
                    ArrayElemTypeDef::Parenthesis(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for ArrayElemTypeDef {
    #[inline]
    fn partial_cmp(&self, other: &ArrayElemTypeDef)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (ArrayElemTypeDef::AngleBracket(__self_0),
                ArrayElemTypeDef::AngleBracket(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (ArrayElemTypeDef::SquareBracket(__self_0, __self_1),
                ArrayElemTypeDef::SquareBracket(__arg1_0, __arg1_1)) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                    cmp => cmp,
                },
            (ArrayElemTypeDef::Parenthesis(__self_0),
                ArrayElemTypeDef::Parenthesis(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Eq for ArrayElemTypeDef {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
        let _: ::core::cmp::AssertParamIsEq<Option<u64>>;
        let _: ::core::cmp::AssertParamIsEq<Box<DataType>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for ArrayElemTypeDef {
    #[inline]
    fn cmp(&self, other: &ArrayElemTypeDef) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (ArrayElemTypeDef::AngleBracket(__self_0),
                        ArrayElemTypeDef::AngleBracket(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (ArrayElemTypeDef::SquareBracket(__self_0, __self_1),
                        ArrayElemTypeDef::SquareBracket(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (ArrayElemTypeDef::Parenthesis(__self_0),
                        ArrayElemTypeDef::Parenthesis(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::hash::Hash for ArrayElemTypeDef {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            ArrayElemTypeDef::AngleBracket(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            ArrayElemTypeDef::SquareBracket(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            ArrayElemTypeDef::Parenthesis(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
1138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1139#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for ArrayElemTypeDef {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::AngleBracket(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                            Self::SquareBracket(_0, _1) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                                sqlparser::ast::Visit::visit(_1, visitor)?;
                            }
                            Self::Parenthesis(_0) => {
                                sqlparser::ast::Visit::visit(_0, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for ArrayElemTypeDef {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::None => {}
                            Self::AngleBracket(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                            Self::SquareBracket(_0, _1) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                                sqlparser::ast::VisitMut::visit(_1, visitor)?;
                            }
                            Self::Parenthesis(_0) => {
                                sqlparser::ast::VisitMut::visit(_0, visitor)?;
                            }
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1140pub enum ArrayElemTypeDef {
1141    /// Use `ARRAY` style without an explicit element type.
1142    None,
1143    /// Angle-bracket style, e.g. `ARRAY<INT>`.
1144    AngleBracket(Box<DataType>),
1145    /// Square-bracket style, e.g. `INT[]` or `INT[2]`.
1146    SquareBracket(Box<DataType>, Option<u64>),
1147    /// Parenthesis style, e.g. `Array(Int64)`.
1148    Parenthesis(Box<DataType>),
1149}
1150
1151/// Represents different types of geometric shapes which are commonly used in
1152/// PostgreSQL/Redshift for spatial operations and geometry-related computations.
1153///
1154/// [PostgreSQL]: https://www.postgresql.org/docs/9.5/functions-geometry.html
1155#[derive(#[automatically_derived]
impl ::core::fmt::Debug for GeometricTypeKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                GeometricTypeKind::Point => "Point",
                GeometricTypeKind::Line => "Line",
                GeometricTypeKind::LineSegment => "LineSegment",
                GeometricTypeKind::GeometricBox => "GeometricBox",
                GeometricTypeKind::GeometricPath => "GeometricPath",
                GeometricTypeKind::Polygon => "Polygon",
                GeometricTypeKind::Circle => "Circle",
            })
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for GeometricTypeKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for GeometricTypeKind {
    #[inline]
    fn clone(&self) -> GeometricTypeKind { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for GeometricTypeKind {
    #[inline]
    fn eq(&self, other: &GeometricTypeKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for GeometricTypeKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::hash::Hash for GeometricTypeKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[automatically_derived]
impl ::core::cmp::PartialOrd for GeometricTypeKind {
    #[inline]
    fn partial_cmp(&self, other: &GeometricTypeKind)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::PartialOrd::partial_cmp(&__self_discr, &__arg1_discr)
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Ord for GeometricTypeKind {
    #[inline]
    fn cmp(&self, other: &GeometricTypeKind) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord)]
1156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1157#[cfg_attr(feature = "visitor", derive(impl sqlparser::ast::Visit for GeometricTypeKind {
    fn visit<V: sqlparser::ast::Visitor>(&self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Point => {}
                            Self::Line => {}
                            Self::LineSegment => {}
                            Self::GeometricBox => {}
                            Self::GeometricPath => {}
                            Self::Polygon => {}
                            Self::Circle => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}Visit, impl sqlparser::ast::VisitMut for GeometricTypeKind {
    fn visit<V: sqlparser::ast::VisitorMut>(&mut self, visitor: &mut V)
        -> ::std::ops::ControlFlow<V::Break> {
        ::recursive::__impl::stacker::maybe_grow(::recursive::get_minimum_stack_size(),
            ::recursive::get_stack_allocation_size(),
            move || -> ::std::ops::ControlFlow<V::Break>
                {
                    {
                        match self {
                            Self::Point => {}
                            Self::Line => {}
                            Self::LineSegment => {}
                            Self::GeometricBox => {}
                            Self::GeometricPath => {}
                            Self::Polygon => {}
                            Self::Circle => {}
                        }
                        ::std::ops::ControlFlow::Continue(())
                    }
                })
    }
}VisitMut))]
1158pub enum GeometricTypeKind {
1159    /// Point geometry
1160    Point,
1161    /// Line geometry
1162    Line,
1163    /// Line segment geometry
1164    LineSegment,
1165    /// Box geometry
1166    GeometricBox,
1167    /// Path geometry
1168    GeometricPath,
1169    /// Polygon geometry
1170    Polygon,
1171    /// Circle geometry
1172    Circle,
1173}
1174
1175impl fmt::Display for GeometricTypeKind {
1176    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1177        match self {
1178            GeometricTypeKind::Point => f.write_fmt(format_args!("point"))write!(f, "point"),
1179            GeometricTypeKind::Line => f.write_fmt(format_args!("line"))write!(f, "line"),
1180            GeometricTypeKind::LineSegment => f.write_fmt(format_args!("lseg"))write!(f, "lseg"),
1181            GeometricTypeKind::GeometricBox => f.write_fmt(format_args!("box"))write!(f, "box"),
1182            GeometricTypeKind::GeometricPath => f.write_fmt(format_args!("path"))write!(f, "path"),
1183            GeometricTypeKind::Polygon => f.write_fmt(format_args!("polygon"))write!(f, "polygon"),
1184            GeometricTypeKind::Circle => f.write_fmt(format_args!("circle"))write!(f, "circle"),
1185        }
1186    }
1187}