Pre: Move Entid and KnownEntid into core_traits

This commit is contained in:
Grisha Kruglov 2018-08-08 10:35:06 -07:00
parent f8478835a2
commit 163635a4a7
60 changed files with 284 additions and 91 deletions

View file

@ -43,6 +43,9 @@ features = ["limits"]
[dependencies.edn] [dependencies.edn]
path = "edn" path = "edn"
[dependencies.core_traits]
path = "core-traits"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "core" path = "core"

11
core-traits/Cargo.toml Normal file
View file

@ -0,0 +1,11 @@
[package]
name = "core_traits"
version = "0.0.1"
workspace = ".."
[lib]
name = "core_traits"
path = "lib.rs"
[dependencies.edn]
path = "../edn"

55
core-traits/lib.rs Normal file
View file

@ -0,0 +1,55 @@
// Copyright 2018 Mozilla
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
extern crate edn;
use edn::entities::{
AttributePlace,
EntityPlace,
EntidOrIdent,
ValuePlace,
TransactableValueMarker,
};
/// Represents one entid in the entid space.
///
/// Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite
/// stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we
/// use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.
pub type Entid = i64;
/// An entid that's either already in the store, or newly allocated to a tempid.
/// TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct KnownEntid(pub Entid);
impl From<KnownEntid> for Entid {
fn from(k: KnownEntid) -> Entid {
k.0
}
}
impl<V: TransactableValueMarker> Into<EntityPlace<V>> for KnownEntid {
fn into(self) -> EntityPlace<V> {
EntityPlace::Entid(EntidOrIdent::Entid(self.0))
}
}
impl Into<AttributePlace> for KnownEntid {
fn into(self) -> AttributePlace {
AttributePlace::Entid(EntidOrIdent::Entid(self.0))
}
}
impl<V: TransactableValueMarker> Into<ValuePlace<V>> for KnownEntid {
fn into(self) -> ValuePlace<V> {
ValuePlace::Entid(EntidOrIdent::Entid(self.0))
}
}

View file

@ -14,6 +14,9 @@ uuid = { version = "0.5", features = ["v4", "serde"] }
serde = { version = "1.0", features = ["rc"] } serde = { version = "1.0", features = ["rc"] }
serde_derive = "1.0" serde_derive = "1.0"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.edn] [dependencies.edn]
path = "../edn" path = "../edn"
features = ["serde_support"] features = ["serde_support"]

View file

@ -14,8 +14,11 @@ use std::collections::{
BTreeSet, BTreeSet,
}; };
use ::{ use core_traits::{
Entid, Entid,
};
use ::{
Schema, Schema,
TypedValue, TypedValue,
}; };

View file

@ -16,6 +16,8 @@ extern crate ordered_float;
extern crate uuid; extern crate uuid;
extern crate serde; extern crate serde;
extern crate core_traits;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
@ -24,6 +26,11 @@ extern crate serde_derive;
extern crate edn; extern crate edn;
use core_traits::{
Entid,
KnownEntid,
};
pub mod values; pub mod values;
mod cache; mod cache;
@ -70,8 +77,6 @@ pub use tx_report::{
pub use types::{ pub use types::{
Binding, Binding,
Entid,
KnownEntid,
StructuredMap, StructuredMap,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -14,9 +14,12 @@ use std::collections::{
BTreeMap, BTreeMap,
}; };
use core_traits::{
Entid,
};
use ::{ use ::{
DateTime, DateTime,
Entid,
Utc, Utc,
}; };

View file

@ -57,32 +57,15 @@ use ::edn::{
}; };
use ::edn::entities::{ use ::edn::entities::{
AttributePlace,
EntidOrIdent,
EntityPlace,
ValuePlace,
TransactableValueMarker, TransactableValueMarker,
}; };
use values; use values;
/// Represents one entid in the entid space. use core_traits::{
/// Entid,
/// Per https://www.sqlite.org/datatype3.html (see also http://stackoverflow.com/a/8499544), SQLite KnownEntid,
/// stores signed integers up to 64 bits in size. Since u32 is not appropriate for our use case, we };
/// use i64 rather than manually truncating u64 to u63 and casting to i64 throughout the codebase.
pub type Entid = i64;
/// An entid that's either already in the store, or newly allocated to a tempid.
/// TODO: we'd like to link this in some way to the lifetime of a particular PartitionMap.
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct KnownEntid(pub Entid);
impl From<KnownEntid> for Entid {
fn from(k: KnownEntid) -> Entid {
k.0
}
}
impl From<KnownEntid> for TypedValue { impl From<KnownEntid> for TypedValue {
fn from(k: KnownEntid) -> TypedValue { fn from(k: KnownEntid) -> TypedValue {
@ -90,24 +73,6 @@ impl From<KnownEntid> for TypedValue {
} }
} }
impl<V: TransactableValueMarker> Into<EntityPlace<V>> for KnownEntid {
fn into(self) -> EntityPlace<V> {
EntityPlace::Entid(EntidOrIdent::Entid(self.0))
}
}
impl Into<AttributePlace> for KnownEntid {
fn into(self) -> AttributePlace {
AttributePlace::Entid(EntidOrIdent::Entid(self.0))
}
}
impl<V: TransactableValueMarker> Into<ValuePlace<V>> for KnownEntid {
fn into(self) -> ValuePlace<V> {
ValuePlace::Entid(EntidOrIdent::Entid(self.0))
}
}
/// The attribute of each Mentat assertion has a :db/valueType constraining the value to a /// The attribute of each Mentat assertion has a :db/valueType constraining the value to a
/// particular set. Mentat recognizes the following :db/valueType values. /// particular set. Mentat recognizes the following :db/valueType values.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)] #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialOrd, PartialEq)]

View file

@ -32,6 +32,9 @@ path = "../edn"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_sql] [dependencies.mentat_sql]
path = "../sql" path = "../sql"

View file

@ -78,10 +78,13 @@ use failure::{
use rusqlite; use rusqlite;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Binding, Binding,
CachedAttributes, CachedAttributes,
Entid,
HasSchema, HasSchema,
Schema, Schema,
TypedValue, TypedValue,

View file

@ -40,11 +40,15 @@ use edn::{
}; };
use entids; use entids;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
attribute, attribute,
Attribute, Attribute,
AttributeBitFlags, AttributeBitFlags,
Entid,
FromMicros, FromMicros,
IdentMap, IdentMap,
Schema, Schema,
@ -1221,10 +1225,12 @@ mod tests {
use edn::entities::{ use edn::entities::{
OpType, OpType,
}; };
use core_traits::{
KnownEntid,
};
use mentat_core::{ use mentat_core::{
HasSchema, HasSchema,
Keyword, Keyword,
KnownEntid,
attribute, attribute,
}; };
use mentat_core::util::Either::*; use mentat_core::util::Either::*;

View file

@ -66,6 +66,11 @@ use db::{read_attribute_map,read_ident_map};
use edn; use edn;
use entids; use entids;
use errors::Result; use errors::Result;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
HasSchema, HasSchema,
SQLValueType, SQLValueType,

View file

@ -14,7 +14,9 @@
/// ///
/// Used through-out the transactor to match core DB constructs. /// Used through-out the transactor to match core DB constructs.
use types::{Entid}; use core_traits::{
Entid,
};
// Added in SQL schema v1. // Added in SQL schema v1.
pub const DB_IDENT: Entid = 1; pub const DB_IDENT: Entid = 1;

View file

@ -26,11 +26,13 @@ use rusqlite;
use edn::entities::{ use edn::entities::{
TempId, TempId,
}; };
use mentat_core::{
use core_traits::{
Entid,
KnownEntid, KnownEntid,
}; };
use types::{ use types::{
Entid,
TypedValue, TypedValue,
ValueType, ValueType,
}; };

View file

@ -18,7 +18,10 @@ use std::collections::{
HashMap, HashMap,
}; };
use mentat_core::KnownEntid; use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::util::Either; use mentat_core::util::Either;
@ -48,7 +51,6 @@ use types::{
Attribute, Attribute,
AVMap, AVMap,
AVPair, AVPair,
Entid,
Schema, Schema,
TransactableValue, TransactableValue,
TypedValue, TypedValue,

View file

@ -25,6 +25,7 @@ extern crate time;
#[macro_use] extern crate edn; #[macro_use] extern crate edn;
#[macro_use] extern crate mentat_core; #[macro_use] extern crate mentat_core;
extern crate core_traits;
extern crate mentat_sql; extern crate mentat_sql;
use std::iter::repeat; use std::iter::repeat;

View file

@ -38,9 +38,13 @@ use errors::{
DbErrorKind, DbErrorKind,
Result, Result,
}; };
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
attribute, attribute,
Entid,
Schema, Schema,
AttributeMap, AttributeMap,
TypedValue, TypedValue,

View file

@ -17,14 +17,18 @@ use errors::{
Result, Result,
}; };
use edn::symbols; use edn::symbols;
use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
attribute, attribute,
Attribute, Attribute,
Entid,
EntidMap, EntidMap,
HasSchema, HasSchema,
IdentMap, IdentMap,
KnownEntid,
Schema, Schema,
AttributeMap, AttributeMap,
TypedValue, TypedValue,

View file

@ -17,11 +17,14 @@ use errors::{
Result, Result,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
KnownEntid,
};
use mentat_core::{
Schema, Schema,
TypedValue, TypedValue,
KnownEntid,
}; };
use edn::{ use edn::{

View file

@ -89,9 +89,13 @@ use internal_types::{
use mentat_core::util::Either; use mentat_core::util::Either;
use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
DateTime, DateTime,
KnownEntid,
Schema, Schema,
TxReport, TxReport,
Utc, Utc,
@ -116,7 +120,6 @@ use types::{
AVMap, AVMap,
AVPair, AVPair,
Attribute, Attribute,
Entid,
PartitionMap, PartitionMap,
TransactableValue, TransactableValue,
TypedValue, TypedValue,

View file

@ -13,8 +13,11 @@ use std::collections::{
BTreeMap, BTreeMap,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
TypedValue, TypedValue,
ValueType, ValueType,
}; };

View file

@ -26,8 +26,11 @@ use indexmap::{
IndexMap, IndexMap,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
Schema, Schema,
TypedValue, TypedValue,
}; };

View file

@ -26,11 +26,14 @@ use std::ops::{
extern crate mentat_core; extern crate mentat_core;
use core_traits::{
Entid,
};
pub use self::mentat_core::{ pub use self::mentat_core::{
Attribute, Attribute,
AttributeBitFlags, AttributeBitFlags,
DateTime, DateTime,
Entid,
Schema, Schema,
TypedValue, TypedValue,
Utc, Utc,

View file

@ -40,10 +40,13 @@ use internal_types::{
use mentat_core::util::Either::*; use mentat_core::util::Either::*;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
attribute, attribute,
Attribute, Attribute,
Entid,
Schema, Schema,
TypedValue, TypedValue,
}; };

View file

@ -17,8 +17,11 @@
// - When observers are registered we want to flip some flags as writes occur so that we can // - When observers are registered we want to flip some flags as writes occur so that we can
// notifying them outside the transaction. // notifying them outside the transaction.
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
Schema, Schema,
TypedValue, TypedValue,
}; };

View file

@ -10,6 +10,9 @@ failure_derive = "0.1.1"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_query] [dependencies.mentat_query]
path = "../query" path = "../query"

View file

@ -25,12 +25,15 @@ use std::fmt::{
Formatter, Formatter,
}; };
use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
Attribute, Attribute,
Cloned, Cloned,
Entid,
HasSchema, HasSchema,
KnownEntid,
Schema, Schema,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -8,9 +8,12 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the // CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Cloned, Cloned,
Entid,
HasSchema, HasSchema,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -13,6 +13,7 @@ extern crate failure;
#[macro_use] extern crate failure_derive; #[macro_use] extern crate failure_derive;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
use std::collections::BTreeSet; use std::collections::BTreeSet;
@ -25,9 +26,12 @@ mod types;
mod validate; mod validate;
mod clauses; mod clauses;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
CachedAttributes, CachedAttributes,
Entid,
Schema, Schema,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -14,8 +14,11 @@ use std::fmt::{
Formatter, Formatter,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
TypedValue, TypedValue,
ValueRc, ValueRc,
ValueType, ValueType,

View file

@ -9,6 +9,7 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;

View file

@ -9,6 +9,7 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;

View file

@ -9,6 +9,7 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;

View file

@ -9,6 +9,7 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;

View file

@ -13,9 +13,12 @@
// this module will get warnings otherwise). // this module will get warnings otherwise).
#![allow(dead_code)] #![allow(dead_code)]
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Attribute, Attribute,
Entid,
Schema, Schema,
ValueType, ValueType,
}; };

View file

@ -12,6 +12,9 @@ indexmap = "1"
version = "0.13" version = "0.13"
features = ["limits"] features = ["limits"]
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"

View file

@ -16,6 +16,7 @@ extern crate indexmap;
extern crate rusqlite; extern crate rusqlite;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_db; // For value conversion. extern crate mentat_db; // For value conversion.
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;

View file

@ -18,7 +18,7 @@ use mentat_query_pull::{
Puller, Puller,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
}; };

View file

@ -13,9 +13,12 @@ use std::collections::{
BTreeSet, BTreeSet,
}; };
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Binding, Binding,
Entid,
Schema, Schema,
StructuredMap, StructuredMap,
TypedValue, TypedValue,

View file

@ -9,13 +9,17 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;
extern crate mentat_query_projector; extern crate mentat_query_projector;
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Attribute, Attribute,
Entid,
Schema, Schema,
ValueType, ValueType,
}; };

View file

@ -14,6 +14,9 @@ features = ["limits"]
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_db] [dependencies.mentat_db]
path = "../db" path = "../db"

View file

@ -14,7 +14,7 @@ use mentat_db::{
DbError, DbError,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
}; };

View file

@ -65,6 +65,7 @@ extern crate failure_derive;
extern crate rusqlite; extern crate rusqlite;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_db; extern crate mentat_db;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;
@ -80,10 +81,13 @@ use std::iter::{
once, once,
}; };
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Binding, Binding,
Cloned, Cloned,
Entid,
HasSchema, HasSchema,
Keyword, Keyword,
Schema, Schema,

View file

@ -5,6 +5,9 @@ workspace = ".."
[dependencies] [dependencies]
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"

View file

@ -9,13 +9,18 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
#[macro_use] extern crate mentat_core; #[macro_use] extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;
extern crate mentat_sql; extern crate mentat_sql;
use std::boxed::Box; use std::boxed::Box;
use mentat_core::{
use core_traits::{
Entid, Entid,
};
use mentat_core::{
SQLTypeAffinity, SQLTypeAffinity,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -10,6 +10,9 @@ failure_derive = "0.1.1"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_sql] [dependencies.mentat_sql]
path = "../sql" path = "../sql"

View file

@ -9,6 +9,7 @@
// specific language governing permissions and limitations under the License. // specific language governing permissions and limitations under the License.
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;
extern crate mentat_query_projector; extern crate mentat_query_projector;
@ -25,9 +26,12 @@ use mentat_query::{
Variable, Variable,
}; };
use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
Attribute, Attribute,
Entid,
Schema, Schema,
TypedValue, TypedValue,
ValueType, ValueType,

View file

@ -45,11 +45,14 @@ use edn::{
InternSet, InternSet,
}; };
pub use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
Attribute, Attribute,
Entid,
HasSchema, HasSchema,
KnownEntid,
Keyword, Keyword,
Schema, Schema,
StructuredMap, StructuredMap,

View file

@ -23,6 +23,7 @@ extern crate uuid;
pub extern crate edn; pub extern crate edn;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_db; extern crate mentat_db;
extern crate mentat_query; extern crate mentat_query;
extern crate mentat_query_algebrizer; extern crate mentat_query_algebrizer;
@ -34,14 +35,17 @@ extern crate mentat_sql;
#[cfg(feature = "syncable")] #[cfg(feature = "syncable")]
extern crate mentat_tolstoy; extern crate mentat_tolstoy;
pub use core_traits::{
Entid,
KnownEntid,
};
pub use mentat_core::{ pub use mentat_core::{
Attribute, Attribute,
Binding, Binding,
DateTime, DateTime,
Entid,
HasSchema, HasSchema,
Keyword, Keyword,
KnownEntid,
Schema, Schema,
StructuredMap, StructuredMap,
TxReport, TxReport,

View file

@ -13,11 +13,14 @@ use rusqlite::types::ToSql;
use std::rc::Rc; use std::rc::Rc;
use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
Binding, Binding,
Entid,
HasSchema, HasSchema,
KnownEntid,
Schema, Schema,
TypedValue, TypedValue,
}; };

View file

@ -13,9 +13,12 @@ use std::collections::{
BTreeMap, BTreeMap,
}; };
pub use core_traits::{
Entid,
};
use mentat_core::{ use mentat_core::{
DateTime, DateTime,
Entid,
Keyword, Keyword,
Binding, Binding,
TypedValue, TypedValue,

View file

@ -26,8 +26,11 @@ use rusqlite;
use edn; use edn;
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
Keyword, Keyword,
StructuredMap, StructuredMap,
TxReport, TxReport,

View file

@ -99,7 +99,7 @@ use mentat_core::attribute::{
Unique, Unique,
}; };
use mentat_core::{ use core_traits::{
KnownEntid, KnownEntid,
}; };

View file

@ -14,6 +14,7 @@ extern crate time;
#[macro_use] #[macro_use]
extern crate mentat; extern crate mentat;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate mentat_db; extern crate mentat_db;
// TODO: when we switch to `failure`, make this more humane. // TODO: when we switch to `failure`, make this more humane.
@ -25,11 +26,14 @@ use std::str::FromStr;
use chrono::FixedOffset; use chrono::FixedOffset;
use core_traits::{
Entid,
KnownEntid,
};
use mentat_core::{ use mentat_core::{
DateTime, DateTime,
Entid,
HasSchema, HasSchema,
KnownEntid,
Utc, Utc,
Uuid, Uuid,
ValueType, ValueType,

View file

@ -10,6 +10,7 @@
extern crate mentat; extern crate mentat;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
#[cfg(feature = "syncable")] #[cfg(feature = "syncable")]
extern crate mentat_tolstoy; extern crate mentat_tolstoy;
@ -27,8 +28,10 @@ mod tests {
TxPart, TxPart,
}; };
use mentat_tolstoy::errors::Result; use mentat_tolstoy::errors::Result;
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
TypedValue, TypedValue,
ValueType, ValueType,
}; };

View file

@ -24,6 +24,9 @@ path = "../edn"
[dependencies.mentat_core] [dependencies.mentat_core]
path = "../core" path = "../core"
[dependencies.core_traits]
path = "../core-traits"
[dependencies.mentat_db] [dependencies.mentat_db]
path = "../db" path = "../db"

View file

@ -34,6 +34,7 @@ extern crate serde_json;
#[cfg_attr(test, macro_use)] extern crate mentat_db; #[cfg_attr(test, macro_use)] extern crate mentat_db;
extern crate mentat_core; extern crate mentat_core;
extern crate core_traits;
extern crate rusqlite; extern crate rusqlite;
extern crate uuid; extern crate uuid;

View file

@ -25,7 +25,10 @@ use serde_json;
use tokio_core::reactor::Core; use tokio_core::reactor::Core;
use uuid::Uuid; use uuid::Uuid;
use mentat_core::Entid; use core_traits::{
Entid,
};
use metadata::SyncMetadataClient; use metadata::SyncMetadataClient;
use metadata::HeadTrackable; use metadata::HeadTrackable;
use schema::ensure_current_version; use schema::ensure_current_version;

View file

@ -11,7 +11,10 @@
use std::collections::HashMap; use std::collections::HashMap;
use rusqlite; use rusqlite;
use uuid::Uuid; use uuid::Uuid;
use mentat_core::Entid;
use core_traits::{
Entid,
};
use errors::{ use errors::{
TolstoyError, TolstoyError,

View file

@ -19,8 +19,11 @@ use mentat_db::{
TypedSQLValue, TypedSQLValue,
}; };
use mentat_core::{ use core_traits::{
Entid, Entid,
};
use mentat_core::{
TypedValue, TypedValue,
}; };