mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-23 00:10:38 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user