diff --git a/Cargo.toml b/Cargo.toml index c1e2afb5..04689e16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,9 +79,6 @@ path = "query-pull-traits" [dependencies.mentat_query_sql] path = "query-sql" -[dependencies.mentat_query_translator] -path = "query-translator" - [dependencies.mentat_tolstoy] path = "tolstoy" optional = true diff --git a/query-projector/src/lib.rs b/query-projector/src/lib.rs index 6365ecd2..0bb1ac46 100644 --- a/query-projector/src/lib.rs +++ b/query-projector/src/lib.rs @@ -74,6 +74,8 @@ use mentat_query_sql::{ Projection, }; +pub mod translate; + mod binding_tuple; pub use binding_tuple::{ BindingTuple, diff --git a/query-translator/src/translate.rs b/query-projector/src/translate.rs similarity index 99% rename from query-translator/src/translate.rs rename to query-projector/src/translate.rs index 05daa80c..f8ed87da 100644 --- a/query-translator/src/translate.rs +++ b/query-projector/src/translate.rs @@ -49,7 +49,7 @@ use mentat_query_algebrizer::{ VariableColumn, }; -use mentat_query_projector::{ +use ::{ CombinedProjection, ConstantProjector, Projector, diff --git a/query-translator/tests/translate.rs b/query-projector/tests/translate.rs similarity index 99% rename from query-translator/tests/translate.rs rename to query-projector/tests/translate.rs index 72ae424c..8dfde18d 100644 --- a/query-translator/tests/translate.rs +++ b/query-projector/tests/translate.rs @@ -13,7 +13,6 @@ extern crate mentat_core; extern crate core_traits; extern crate mentat_query_algebrizer; extern crate mentat_query_projector; -extern crate mentat_query_translator; extern crate mentat_sql; use std::collections::BTreeMap; @@ -49,7 +48,7 @@ use mentat_query_projector::{ ConstantProjector, }; -use mentat_query_translator::{ +use mentat_query_projector::translate::{ ProjectedSelect, query_to_select, }; diff --git a/query-translator/Cargo.toml b/query-translator/Cargo.toml deleted file mode 100644 index 8916f775..00000000 --- a/query-translator/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "mentat_query_translator" -version = "0.0.1" -workspace = ".." - -[dependencies] -failure = "0.1.1" -failure_derive = "0.1.1" - -[dependencies.edn] -path = "../edn" - -[dependencies.mentat_core] -path = "../core" - -[dependencies.core_traits] -path = "../core-traits" - -[dependencies.mentat_sql] -path = "../sql" - -[dependencies.mentat_query_algebrizer] -path = "../query-algebrizer" - -[dependencies.mentat_query_projector] -path = "../query-projector" - -[dependencies.query_projector_traits] -path = "../query-projector-traits" - -[dependencies.mentat_query_sql] -path = "../query-sql" diff --git a/query-translator/README.md b/query-translator/README.md deleted file mode 100644 index ff5cffe2..00000000 --- a/query-translator/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This crate turns an algebrized Datalog query into a domain-specific representation of a SQL query, and then uses `mentat_sql` to turn that into a SQL string to be executed. - -This subsumes both planning and query construction, because in Mentat the SQL query is effectively a query plan. diff --git a/query-translator/src/lib.rs b/query-translator/src/lib.rs deleted file mode 100644 index 0e98a808..00000000 --- a/query-translator/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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 failure; - -extern crate edn; -extern crate core_traits; -extern crate mentat_core; -extern crate mentat_query_algebrizer; -extern crate mentat_query_projector; -extern crate query_projector_traits; -extern crate mentat_query_sql; -extern crate mentat_sql; - -mod translate; - -pub use mentat_query_sql::{ - Projection, -}; - -pub use translate::{ - ProjectedSelect, - cc_to_exists, - query_to_select, -}; - -// query-translator could be folded into query-projector; for now, just type alias the errors. -pub type TranslatorError = query_projector_traits::errors::ProjectorError; -pub type Result = std::result::Result; diff --git a/src/lib.rs b/src/lib.rs index f5d12a6d..c4464d3b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,6 @@ extern crate mentat_query_projector; extern crate query_projector_traits; extern crate mentat_query_pull; extern crate query_pull_traits; -extern crate mentat_query_translator; extern crate mentat_sql; #[cfg(feature = "syncable")] diff --git a/src/query.rs b/src/query.rs index fefcec63..044feacd 100644 --- a/src/query.rs +++ b/src/query.rs @@ -57,15 +57,15 @@ use mentat_query_projector::{ Projector, }; -use mentat_sql::{ - SQLQuery, -}; - -use mentat_query_translator::{ +use mentat_query_projector::translate::{ ProjectedSelect, query_to_select, }; +use mentat_sql::{ + SQLQuery, +}; + pub use mentat_query_algebrizer::{ Known, }; diff --git a/tests/query.rs b/tests/query.rs index dbf6a0d4..a970d524 100644 --- a/tests/query.rs +++ b/tests/query.rs @@ -20,7 +20,6 @@ extern crate mentat_db; // TODO: when we switch to `failure`, make this more humane. extern crate query_algebrizer_traits; // For errors; extern crate query_projector_traits; // For errors. -extern crate mentat_query_translator; // For errors. use std::str::FromStr;