feat: Upgrade rust to nightly-2022-07-14 (#217)

* feat: upgrade rust to nightly-2022-07-14

* style: Fix some clippy warnings

* style: clippy fix

* style: fix clippy

* style: Fix clippy

Some PartialEq warnings have been work around using cfg_attr test

* feat: Implement Eq and PartialEq for PrimitiveType

* chore: Remove unnecessary allow

* chore: Remove usage of cfg_attr for PartialEq
This commit is contained in:
evenyag
2022-09-01 17:50:48 +08:00
committed by GitHub
parent db55c69117
commit d71ae7934e
39 changed files with 85 additions and 61 deletions

View File

@@ -3,7 +3,7 @@ use crate::ast::{ColumnDef, ObjectName, SqlOption, TableConstraint};
/// Time index name, used in table constraints.
pub const TIME_INDEX: &str = "__time_index";
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct CreateTable {
/// Create if not exists
pub if_not_exists: bool,

View File

@@ -3,7 +3,7 @@ use sqlparser::parser::ParserError;
use crate::ast::{Expr, Value};
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Insert {
// Can only be sqlparser::ast::Statement::Insert variant
pub inner: Statement,

View File

@@ -3,7 +3,7 @@ use sqlparser::ast::Query as SpQuery;
use crate::error::Error;
/// Query statement instance.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Query {
pub inner: SpQuery,
}

View File

@@ -1,7 +1,7 @@
use crate::statements::show_kind::ShowKind;
/// SQL structure for `SHOW DATABASES`.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SqlShowDatabase {
pub kind: ShowKind,
}

View File

@@ -2,7 +2,7 @@ use sqlparser::ast::Expr;
use sqlparser::ast::Ident;
/// Show kind for SQL expressions like `SHOW DATABASE` or `SHOW TABLE`
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ShowKind {
All,
Like(Ident),

View File

@@ -7,7 +7,7 @@ use crate::statements::query::Query;
use crate::statements::show_database::SqlShowDatabase;
/// Tokens parsed by `DFParser` are converted into these values.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Statement {
// Databases.
ShowDatabases(SqlShowDatabase),
@@ -41,7 +41,7 @@ impl TryFrom<Statement> for SpStatement {
/// Comment hints from SQL.
/// It'll be enabled when using `--comment` in mysql client.
/// Eg: `SELECT * FROM system.number LIMIT 1; -- { ErrorCode 25 }`
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Hint {
pub error_code: Option<u16>,
pub comment: String,