diff --git a/query-algebrizer/src/cc.rs b/query-algebrizer/src/cc.rs index f09ecf4e..73c6cfcc 100644 --- a/query-algebrizer/src/cc.rs +++ b/query-algebrizer/src/cc.rs @@ -53,6 +53,7 @@ use types::{ ColumnConstraint, DatomsColumn, DatomsTable, + EmptyBecause, NumericComparison, QualifiedAlias, QueryValue, @@ -160,19 +161,6 @@ pub struct ConjoiningClauses { extracted_types: BTreeMap, } -#[derive(PartialEq)] -pub enum EmptyBecause { - // Var, existing, desired. - TypeMismatch(Variable, HashSet, ValueType), - NonNumericArgument, - UnresolvedIdent(NamespacedKeyword), - InvalidAttributeIdent(NamespacedKeyword), - InvalidAttributeEntid(Entid), - InvalidBinding(DatomsColumn, TypedValue), - ValueTypeMismatch(ValueType, TypedValue), - AttributeLookupFailed, // Catch-all, because the table lookup code is lazy. TODO -} - impl Debug for EmptyBecause { fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { use self::EmptyBecause::*; diff --git a/query-algebrizer/src/types.rs b/query-algebrizer/src/types.rs index a726a3c7..274c1cac 100644 --- a/query-algebrizer/src/types.rs +++ b/query-algebrizer/src/types.rs @@ -8,6 +8,8 @@ // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. +use std::collections::HashSet; + use std::fmt::{ Debug, Formatter, @@ -19,6 +21,12 @@ use mentat_core::{ TypedValue, ValueType, }; + +use mentat_query::{ + NamespacedKeyword, + Variable, +}; + /// This enum models the fixed set of default tables we have -- two /// tables and two views. #[derive(PartialEq, Eq, Clone, Copy, Debug)] @@ -204,3 +212,16 @@ impl Debug for ColumnConstraint { } } } + +#[derive(PartialEq)] +pub enum EmptyBecause { + // Var, existing, desired. + TypeMismatch(Variable, HashSet, ValueType), + NonNumericArgument, + UnresolvedIdent(NamespacedKeyword), + InvalidAttributeIdent(NamespacedKeyword), + InvalidAttributeEntid(Entid), + InvalidBinding(DatomsColumn, TypedValue), + ValueTypeMismatch(ValueType, TypedValue), + AttributeLookupFailed, // Catch-all, because the table lookup code is lazy. TODO +} \ No newline at end of file