Skip to content

Commit 62adaec

Browse files
committed
Better Insert API
1 parent adb336f commit 62adaec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+237
-116
lines changed

src/data/index.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
use {
2-
crate::{result::Result, Column, DatabaseInner, Ingredient, Method, Recipe, Value},
2+
crate::{
3+
recipe::{Ingredient, Method, Recipe},
4+
result::Result,
5+
Column, DatabaseInner, Value,
6+
},
37
rayon::prelude::*,
48
serde::{Deserialize, Serialize},
59
std::{cmp::Ordering, collections::HashMap},

src/data/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
mod column;
22
mod index;
33
mod join;
4+
pub mod recipe;
45
mod row;
56
pub(crate) mod schema;
67
mod table;
8+
pub(crate) mod types;
79
pub(crate) mod value;
810

911
pub use {
1012
column::*,
1113
index::{Index, IndexFilter},
1214
join::{join_iters, JoinType},
15+
recipe::RecipeError,
1316
row::{Row, RowError},
1417
schema::*,
1518
table::{get_name, Table, TableError},
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use {
2-
super::{AggregateOperator, BinaryOperator, FunctionOperator, RecipeError, UnaryOperator},
3-
crate::{Result, Value},
2+
crate::{
3+
recipe::{AggregateOperator, BinaryOperator, FunctionOperator, RecipeError, UnaryOperator},
4+
Result, Value,
5+
},
46
sqlparser::ast::{BinaryOperator as AstBinaryOperator, UnaryOperator as AstUnaryOperator},
57
};
68

src/data/recipe/from/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mod method;
2+
pub use method::*;
3+
4+
use {
5+
super::{Ingredient, Recipe},
6+
crate::Value,
7+
};
8+
9+
impl<T: Into<Value>> From<T> for Recipe {
10+
fn from(value: T) -> Recipe {
11+
Recipe::Ingredient(Ingredient::Value(value.into()))
12+
}
13+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod planned;
44
mod resolve;
55

66
use {
7-
crate::{executor::types::ObjectName, Error, Result, Value},
7+
crate::{types::ObjectName, Error, Result, Value},
88
serde::Serialize,
99
sqlparser::ast::{DataType, Expr},
1010
std::fmt::Debug,
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use {
22
super::{Ingredient, Method, Recipe, RecipeError, TryIntoMethod},
33
crate::{
4-
executor::{query::JoinManual, types::ObjectName},
5-
Resolve, Result, SimplifyBy, TempDB, Value,
4+
query::JoinManual,
5+
recipe::{Resolve, SimplifyBy},
6+
types::ObjectName,
7+
Result, TempDB, Value,
68
},
79
sqlparser::ast::{Expr, FunctionArg, FunctionArgExpr, Ident},
810
std::convert::TryFrom,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use {
33
Ingredient, MetaRecipe, Method, Recipe, RecipeError, RecipeUtilities, Resolve, SimplifyBy,
44
},
55
crate::{
6-
executor::types::{ColumnInfo, Row},
6+
types::{ColumnInfo, Row},
77
IndexFilter, Result, Value,
88
},
99
fstrings::*,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use {
22
super::{Ingredient, Method, Recipe, RecipeError, RecipeUtilities},
3-
crate::{executor::types::Row, Result, Value},
3+
crate::{types::Row, Result, Value},
44
};
55

66
#[derive(Clone)]
File renamed without changes.

src/databases/csv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod mutable;
55
mod record;
66
mod utils;
77

8-
pub use {discern::*, record::*};
8+
pub use record::*;
99

1010
use {
1111
crate::{data::Schema, DBFull, Database, Result, WIPError},

0 commit comments

Comments
 (0)