Skip to content

Commit

Permalink
20230830-6-remove useless import
Browse files Browse the repository at this point in the history
  • Loading branch information
syf20020816 committed Aug 30, 2023
1 parent af9405f commit 13fcace
Show file tree
Hide file tree
Showing 24 changed files with 13 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Surrealism relies on Surrealdb's official Rust standard library:surrealdb,The pu

```toml
[dependencies]
surrealism = {version="0.2.0",features=["builder"]}
surrealism = {version="0.2.0"}
tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread"] }
```

Expand Down
2 changes: 0 additions & 2 deletions surrealism/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ regex = "1.9.1"
except-plugin = { version = "0.0.1", features = ["macros"] }


[features]
builder = []
2 changes: 1 addition & 1 deletion surrealism/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Surrealism relies on Surrealdb's official Rust standard library:surrealdb,The pu

```toml
[dependencies]
surrealism = {version="0.2.0",features=["builder"]}
surrealism = {version="0.2.0"}
tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread"] }
```

Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ pub trait CreateWrapperImpl: BaseWrapperImpl + TableImpl + ReturnImpl + TimeoutI
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct CreateWrapper {
table: Table,
Expand Down
4 changes: 1 addition & 3 deletions surrealism/src/core/builder/define.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
//! ```
//!
use crate::core::db::constants::{NAMESPACE, DATABASE, PASSHASH, PASSWORD, DEFINE_DB, DEFINE_NS, DEFINE_LOGIN, DEFINE_SCOPE, STMT_END, ON, TYPE, SCOPE, PS256, PS384, PS512, EDDSA, ES256, ES384, ES512, HS256, HS384, HS512, RS256, RS384, RS512, VALUE, DEFINE_TOKEN, SCHEMA_FULL, SCHEMA_LESS, AS, SIGN_IN, SIGN_UP, DROP, DEFINE_TABLE, BLANK, NONE, FULL, FOR, DEFINE_EVENT, ON_TABLE, WHEN, THEN, DEFINE_FUNCTION, RETURN, DEFINE_FIELD, FIELDS, COLUMNS, DEFINE_INDEX, UNIQUE, DEFINE_PARAM};
use crate::core::db::constants::{NAMESPACE, DATABASE, PASSHASH, PASSWORD, DEFINE_DB, DEFINE_NS, DEFINE_LOGIN, DEFINE_SCOPE, STMT_END, ON, TYPE, SCOPE, PS256, PS384, PS512, EDDSA, ES256, ES384, ES512, HS256, HS384, HS512, RS256, RS384, RS512, VALUE, DEFINE_TOKEN, SCHEMA_FULL, SCHEMA_LESS, SIGN_IN, SIGN_UP, DROP, DEFINE_TABLE, BLANK, NONE, FULL, FOR, DEFINE_EVENT, ON_TABLE, WHEN, THEN, DEFINE_FUNCTION, RETURN, DEFINE_FIELD, FIELDS, COLUMNS, DEFINE_INDEX, UNIQUE, DEFINE_PARAM};
use crate::{Condition, ParamCombine, SurrealValue, TimeOut, ValueConstructor};
use crate::core::builder::select::SelectWrapper;

/// # DefineWrapper
/// The DEFINE statement can be used to specify authentication access and behaviour, global parameters, table configurations, table events, schema definitions, and indexes.
Expand Down Expand Up @@ -82,7 +81,6 @@ use crate::core::builder::select::SelectWrapper;
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub enum DefineWrapper<'w> {
NONE,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub trait DeleteWrapperImpl: BaseWrapperImpl + TableImpl + ReturnImpl + TimeoutI
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct DeleteWrapper {
table: Table,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

use crate::core::db::constants::{INFO, KV, DB, SCOPE, TABLE, STMT_END, NS};

#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub enum InfoWrapper<'w> {
KV,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub trait InsertWrapperImpl: BaseWrapperImpl + TableImpl {
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct InsertWrapper {
table: Table,
Expand Down
5 changes: 2 additions & 3 deletions surrealism/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use self::select::{SelectWrapper};
use self::info::InfoWrapper;
use self::remove::RemoveWrapper;
use self::define::*;
use self::update::{UpdateWrapper, UpdateWrapperImpl};
use self::create::{CreateWrapper, CreateWrapperImpl};
use self::update::{UpdateWrapper};
use self::create::{CreateWrapper};
use crate::core::db::{ReturnType, TimeOut, SurrealID, TimeUnit};

/// SQLBuilderFactory for Surrealism
Expand All @@ -37,7 +37,6 @@ use crate::core::db::{ReturnType, TimeOut, SurrealID, TimeUnit};
/// - UpdateWrapper
/// - InsertWrapper
/// - DeleteWrapper
#[cfg(feature = "builder")]
pub struct SQLBuilderFactory;

impl SQLBuilderFactory {
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/relate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub trait RelateWrapperImpl: BaseWrapperImpl + ReturnImpl + TimeoutImpl + Parall
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct RelateWrapper {
table_from: Table,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ use crate::core::db::constants::{REMOVE_INDEX, REMOVE_PARAM, ON, ON_TABLE, REMOV
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub enum RemoveWrapper<'w> {
NONE,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub trait SelectWrapperImpl<'w>: TableImpl + ParallelImpl + ConditionImpl + Time
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct SelectWrapper<'w> {
field: Field<'w>,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::core::db::constants::{BEGIN_TRANSACTION, CANCEL_TRANSACTION, COMMIT_T
/// 1. BEGIN [ TRANSACTION ]; 开始
/// 2. CANCEL [ TRANSACTION ]; 取消
/// 3. COMMIT [ TRANSACTION ]; 提交
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct Transaction<'t> {
stmts: Vec<&'t str>,
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/builder/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ pub trait UpdateWrapperImpl<'w>: BaseWrapperImpl + ReturnImpl + ParallelImpl + T
/// Ok(())
/// }
/// ```
#[cfg(feature = "builder")]
#[derive(Debug, Clone)]
pub struct UpdateWrapper<'w> {
table: Table,
Expand Down
2 changes: 1 addition & 1 deletion surrealism/src/core/db/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use serde::{Serialize, Deserialize};
use crate::SurrealValue;
use super::{ParamCombine};
use super::constants::{EQ, LT, GT, GTE, LTE, LINK, NEQ, WHERE, BLANK, AND, OR};
use super::constants::{EQ, LT, GT, GTE, LTE, LINK, NEQ, WHERE, AND, OR};

/// where condition for statment
/// ## example
Expand Down
2 changes: 1 addition & 1 deletion surrealism/src/core/db/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use std::collections::HashMap;
use serde::Serialize;
use super::{SurrealValue, Object, ParamCombine};
use super::constants::{CONTENT, SET, PATCH, MERGE, LEFT_BRACE, RIGHT_BRACE};
use super::constants::{CONTENT, SET, MERGE, LEFT_BRACE, RIGHT_BRACE};

/// # SurrealContent
/// ContentSet is used to create wrapper `content | set` param
Expand Down
2 changes: 0 additions & 2 deletions surrealism/src/core/db/functions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::{Array, SurrealValue};

mod array;
mod count;

Expand Down
2 changes: 0 additions & 2 deletions surrealism/src/core/db/id.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use serde::{Serialize, Deserialize};
use serde_json::Value;

use crate::util::handle_str;
use super::constants::{UUID, ULID, RAND, EQ};
use super::{SurrealValue,Object,Array,ParamCombine};
/// # ID的枚举类型
Expand Down
2 changes: 1 addition & 1 deletion surrealism/src/core/db/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'o> Order<'o> {
pub fn build(&self) -> String {
match self {
Order::Asc(asc) => format!("{} {}", asc.join(" , "), ASC),
Order::Desc(desc) => format!("{} {}", desc.join(" , "), ASC),
Order::Desc(desc) => format!("{} {}", desc.join(" , "), DESC),
Order::Rand => String::from(RAND)
}
}
Expand Down
2 changes: 0 additions & 2 deletions surrealism/src/core/db/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
use serde::{Serialize, Deserialize};
use serde_json::json;
use crate::{ParamCombine, SurrealValue};
use crate::util::remove_half;
use super::constants::{LEFT_BRACE, RIGHT_BRACE};

const ADD: &str = "add";
const REPLACE: &str = "replace";
Expand Down
1 change: 0 additions & 1 deletion surrealism/src/core/db/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//! @version:0.0.1
//! @description:
//! ```
use std::ops::Deref;
use crate::{ParamCombine, SurrealValue};
use serde::{Serialize, Deserialize};
use super::{Operator};
Expand Down
2 changes: 1 addition & 1 deletion surrealism/src/core/db/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! @description:
//! ```
use crate::{Object, ParamCombine, Set};
use super::{ContentSet, Patch};
use super::{Patch};
use super::constants::{SET, CONTENT, MERGE, PATCH};
use serde::{Serialize, Deserialize};

Expand Down
6 changes: 3 additions & 3 deletions surrealism/src/core/db/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ use std::collections::{BTreeMap, HashMap};
use serde::{Serialize, Deserialize};
use serde_json::Value;
use surrealdb::sql::{Datetime, Duration};
use crate::{Condition, Criteria};
use crate::core::db::constants::{BLANK, STMT_END};
use crate::{Condition};
use crate::core::db::constants::{BLANK};
use crate::util::{remove_format_half, handle_str};
use super::constants::{NULL, NULL_DOWN, NONE_DOWN, NONE, TRUE, TRUE_STR, FALSE, FALSE_STR, LEFT_BRACE, RIGHT_BRACE, COMMA};
use super::constants::{NULL, NULL_DOWN, NONE_DOWN, NONE, LEFT_BRACE, RIGHT_BRACE, COMMA};

/// SurrealDB对应的值类型
/// Geometry类型当前版本不支持,预计版本 > 0.2.1
Expand Down
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
surrealism = { path = "../surrealism", features = ["builder"] }
surrealism = { path = "../surrealism"}
tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread"] }
serde = { version = "1.0.162", features = ["derive"] }
serde_json = "1.0.96"

0 comments on commit 13fcace

Please sign in to comment.