-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix clippy
- Loading branch information
1 parent
d3436e5
commit 3268541
Showing
10 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use super::db_key_value::DbKeyValue; | ||
|
||
pub struct DbElement { | ||
pub index: u64, | ||
pub values: Vec<DbKeyValue>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use crate::DbKey; | ||
use crate::DbValue; | ||
|
||
pub struct DbKeyValue { | ||
pub key: DbKey, | ||
pub value: DbValue, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,29 @@ | ||
mod insert_edges_query; | ||
mod insert_nodes_query; | ||
mod insert_values_query; | ||
mod query_error; | ||
mod query_ids; | ||
mod query_result; | ||
mod query_values; | ||
|
||
use self::insert_edges_query::InsertEdgesQuery; | ||
use self::insert_nodes_query::InsertNodeQuery; | ||
use self::insert_values_query::InsertValuesQuery; | ||
use self::query_values::QueryValues; | ||
pub use query_error::QueryError; | ||
pub use query_result::QueryResult; | ||
|
||
#[derive(Default)] | ||
pub struct Query {} | ||
pub enum Query { | ||
InsertEdges(InsertEdgesQuery), | ||
InsertNodes(InsertNodeQuery), | ||
InsertValues(InsertValuesQuery), | ||
} | ||
|
||
impl Default for Query { | ||
fn default() -> Self { | ||
Query::InsertNodes(InsertNodeQuery { | ||
count: 0, | ||
values: QueryValues::None, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use super::query_ids::QueryIds; | ||
use super::query_values::QueryValues; | ||
|
||
pub struct InsertEdgesQuery { | ||
pub from: QueryIds, | ||
pub to: QueryIds, | ||
pub count: u64, | ||
pub values: QueryValues, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use super::query_values::QueryValues; | ||
|
||
pub struct InsertNodeQuery { | ||
pub count: u64, | ||
pub values: QueryValues, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use super::query_ids::QueryIds; | ||
use super::query_values::QueryValues; | ||
|
||
pub struct InsertValuesQuery { | ||
pub ids: QueryIds, | ||
pub values: QueryValues, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use crate::Query; | ||
|
||
#[allow(dead_code)] | ||
pub enum QueryIds { | ||
Ids(Vec<u64>), | ||
Query(Box<Query>), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
use crate::db::db_element::DbElement; | ||
|
||
#[derive(Default)] | ||
pub struct QueryResult {} | ||
pub struct QueryResult { | ||
pub result: u64, | ||
pub elements: Vec<DbElement>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use crate::db::db_key_value::DbKeyValue; | ||
use crate::Query; | ||
|
||
#[allow(dead_code)] | ||
pub enum QueryValues { | ||
None, | ||
Values(Vec<Vec<DbKeyValue>>), | ||
Query(Box<Query>), | ||
} |