diff --git a/src/ast/comments.rs b/src/ast/comments.rs index b398474b3..7744c89e2 100644 --- a/src/ast/comments.rs +++ b/src/ast/comments.rs @@ -25,7 +25,7 @@ use core::{ use crate::tokenizer::{Location, Span}; /// An opaque container for comments from a parse SQL source code. -#[derive(Default, Debug)] +#[derive(Default, Debug, Clone)] pub struct Comments(Vec); impl Comments { @@ -151,7 +151,7 @@ impl From for Vec { } /// A source code comment with information of its entire span. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct CommentWithSpan { /// The source code comment iself pub comment: Comment, @@ -168,7 +168,7 @@ impl Deref for CommentWithSpan { } /// A unified type of the different source code comment formats. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Comment { /// A single line comment, typically introduced with a prefix and spanning /// until end-of-line or end-of-file in the source code. diff --git a/src/ast/data_type.rs b/src/ast/data_type.rs index 535a52323..285eec505 100644 --- a/src/ast/data_type.rs +++ b/src/ast/data_type.rs @@ -894,7 +894,7 @@ fn format_clickhouse_datetime_precision_and_timezone( } /// Type of brackets used for `STRUCT` literals. -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum StructBracketKind { diff --git a/src/ast/ddl.rs b/src/ast/ddl.rs index 6c8314421..23fcc0101 100644 --- a/src/ast/ddl.rs +++ b/src/ast/ddl.rs @@ -570,7 +570,7 @@ impl fmt::Display for AlterPolicyOperation { /// [MySQL] `ALTER TABLE` algorithm. /// /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Algorithm option for `ALTER TABLE` operations (MySQL-specific). @@ -599,7 +599,7 @@ impl fmt::Display for AlterTableAlgorithm { /// [MySQL] `ALTER TABLE` lock. /// /// [MySQL]: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Locking behavior for `ALTER TABLE` (MySQL-specific). @@ -1445,7 +1445,7 @@ impl fmt::Display for IndexOption { /// [PostgreSQL] unique index nulls handling option: `[ NULLS [ NOT ] DISTINCT ]` /// /// [PostgreSQL]: https://www.postgresql.org/docs/17/sql-altertable.html -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum NullsDistinctOption { @@ -1756,7 +1756,7 @@ pub struct IdentityParameters { /// ORDER | NOORDER /// ``` /// [Snowflake]: https://docs.snowflake.com/en/sql-reference/sql/create-table -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum IdentityPropertyOrder { @@ -2128,7 +2128,7 @@ impl fmt::Display for ColumnOption { /// `GeneratedAs`s are modifiers that follow a column option in a `generated`. /// 'ExpStored' is used for a column generated from an expression and stored. -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum GeneratedAs { @@ -2142,7 +2142,7 @@ pub enum GeneratedAs { /// `GeneratedExpressionMode`s are modifiers that follow an expression in a `generated`. /// No modifier is typically the same as Virtual. -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum GeneratedExpressionMode { @@ -3799,7 +3799,7 @@ impl Spanned for RenameTableNameKind { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Whether the syntax used for the trigger object (ROW or STATEMENT) is `FOR` or `FOR EACH`. diff --git a/src/ast/dml.rs b/src/ast/dml.rs index 150a54892..32c023e05 100644 --- a/src/ast/dml.rs +++ b/src/ast/dml.rs @@ -401,7 +401,7 @@ impl Display for MergeClause { /// ``` /// [Snowflake](https://docs.snowflake.com/en/sql-reference/sql/merge) /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#merge_statement) -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum MergeClauseKind { diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 9115bb29d..7e0f1a104 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -8526,7 +8526,7 @@ impl fmt::Display for TableOptionsClustered { } /// Specifies which partition the boundary values on table partitioning belongs to. -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum PartitionRangeDirection { diff --git a/src/ast/query.rs b/src/ast/query.rs index 86f3d13b7..d8af243f7 100644 --- a/src/ast/query.rs +++ b/src/ast/query.rs @@ -322,7 +322,7 @@ impl fmt::Display for Table { } /// What did this select look like? -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] pub enum SelectFlavor { @@ -649,7 +649,7 @@ impl fmt::Display for With { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Indicates whether a CTE is materialized or not. @@ -1185,7 +1185,7 @@ pub struct TableFunctionArgs { pub settings: Option>, } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Type of index hint (e.g., `USE`, `IGNORE`, `FORCE`). @@ -1208,7 +1208,7 @@ impl fmt::Display for TableIndexHintType { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// The kind of index referenced by an index hint (e.g. `USE INDEX`). @@ -1228,7 +1228,7 @@ impl fmt::Display for TableIndexType { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Which clause the table index hint applies to. @@ -1579,7 +1579,7 @@ pub struct TableSample { pub offset: Option, } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Modifier specifying whether `SAMPLE` or `TABLESAMPLE` keyword was used. @@ -1630,7 +1630,7 @@ impl fmt::Display for TableSampleQuantity { } /// The table sample method names -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Sampling method used by `TABLESAMPLE`. @@ -1674,7 +1674,7 @@ impl fmt::Display for TableSampleSeed { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Modifier specifying how the sample seed is applied. @@ -1694,7 +1694,7 @@ impl fmt::Display for TableSampleSeedModifier { } } -#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// Unit used with a `TABLESAMPLE` quantity (rows or percent). diff --git a/src/ast/value.rs b/src/ast/value.rs index dc46a5bbb..8879a252b 100644 --- a/src/ast/value.rs +++ b/src/ast/value.rs @@ -484,7 +484,7 @@ impl fmt::Display for DateTimeField { } } -#[derive(Debug, Clone, PartialEq, Eq, Ord, PartialOrd, Hash)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] /// The Unicode Standard defines four normalization forms, which are intended to eliminate