parent
d4166cc67c
commit
e68cc4016c
20 changed files with 17 additions and 49 deletions
|
@ -70,9 +70,6 @@ path = "query-sql"
|
||||||
[dependencies.mentat_query_translator]
|
[dependencies.mentat_query_translator]
|
||||||
path = "query-translator"
|
path = "query-translator"
|
||||||
|
|
||||||
[dependencies.mentat_tx]
|
|
||||||
path = "tx"
|
|
||||||
|
|
||||||
[dependencies.mentat_tolstoy]
|
[dependencies.mentat_tolstoy]
|
||||||
path = "tolstoy"
|
path = "tolstoy"
|
||||||
|
|
||||||
|
|
|
@ -183,10 +183,6 @@ This crate defines the structs and enums that are the output of the query parser
|
||||||
|
|
||||||
Similarly, this crate defines an abstract representation of a SQL query as understood by Mentat. This bridges between Mentat's types (_e.g._, `TypedValue`) and SQL concepts (`ColumnOrExpression`, `GroupBy`). It's produced by the algebrizer and consumed by the translator.
|
Similarly, this crate defines an abstract representation of a SQL query as understood by Mentat. This bridges between Mentat's types (_e.g._, `TypedValue`) and SQL concepts (`ColumnOrExpression`, `GroupBy`). It's produced by the algebrizer and consumed by the translator.
|
||||||
|
|
||||||
#### `mentat_tx`
|
|
||||||
|
|
||||||
Mentat has two main inputs: reads (queries) and writes (transacts). Just as `mentat_query` defines the types produced by the query parser, `mentat_tx` defines the types produced by the tx parser.
|
|
||||||
|
|
||||||
### Query processing
|
### Query processing
|
||||||
|
|
||||||
#### `mentat_query_algebrizer`
|
#### `mentat_query_algebrizer`
|
||||||
|
|
|
@ -27,9 +27,6 @@ path = "../core"
|
||||||
[dependencies.mentat_sql]
|
[dependencies.mentat_sql]
|
||||||
path = "../sql"
|
path = "../sql"
|
||||||
|
|
||||||
[dependencies.mentat_tx]
|
|
||||||
path = "../tx"
|
|
||||||
|
|
||||||
# Should be dev-dependencies.
|
# Should be dev-dependencies.
|
||||||
[dependencies.tabwriter]
|
[dependencies.tabwriter]
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
|
|
|
@ -16,7 +16,7 @@ use edn::types::Value;
|
||||||
use edn::symbols;
|
use edn::symbols;
|
||||||
use entids;
|
use entids;
|
||||||
use db::TypedSQLValue;
|
use db::TypedSQLValue;
|
||||||
use mentat_tx::entities::Entity;
|
use edn::entities::Entity;
|
||||||
use mentat_core::{
|
use mentat_core::{
|
||||||
IdentMap,
|
IdentMap,
|
||||||
Schema,
|
Schema,
|
||||||
|
|
|
@ -97,7 +97,7 @@ use mentat_sql::{
|
||||||
SQLQuery,
|
SQLQuery,
|
||||||
};
|
};
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
OpType,
|
OpType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1096,7 +1096,7 @@ mod tests {
|
||||||
InternSet,
|
InternSet,
|
||||||
};
|
};
|
||||||
use mentat_core::util::Either::*;
|
use mentat_core::util::Either::*;
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
OpType,
|
OpType,
|
||||||
TempId,
|
TempId,
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,7 +31,9 @@ use mentat_core::{
|
||||||
TypedValue,
|
TypedValue,
|
||||||
ValueType,
|
ValueType,
|
||||||
};
|
};
|
||||||
use mentat_tx::entities::{Entid};
|
use edn::entities::{
|
||||||
|
Entid,
|
||||||
|
};
|
||||||
use schema::{
|
use schema::{
|
||||||
SchemaBuilding,
|
SchemaBuilding,
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,7 @@ use std::collections::{
|
||||||
|
|
||||||
use rusqlite;
|
use rusqlite;
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
TempId,
|
TempId,
|
||||||
};
|
};
|
||||||
use mentat_core::{
|
use mentat_core::{
|
||||||
|
|
|
@ -47,8 +47,8 @@ use types::{
|
||||||
TypedValue,
|
TypedValue,
|
||||||
ValueType,
|
ValueType,
|
||||||
};
|
};
|
||||||
use mentat_tx::entities;
|
use edn::entities;
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
EntityPlace,
|
EntityPlace,
|
||||||
OpType,
|
OpType,
|
||||||
TempId,
|
TempId,
|
||||||
|
|
|
@ -26,7 +26,6 @@ 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 mentat_sql;
|
extern crate mentat_sql;
|
||||||
extern crate mentat_tx;
|
|
||||||
|
|
||||||
use std::iter::repeat;
|
use std::iter::repeat;
|
||||||
|
|
||||||
|
|
|
@ -103,8 +103,8 @@ use mentat_core::{
|
||||||
|
|
||||||
use mentat_core::intern_set::InternSet;
|
use mentat_core::intern_set::InternSet;
|
||||||
|
|
||||||
use mentat_tx::entities as entmod;
|
use edn::entities as entmod;
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
AttributePlace,
|
AttributePlace,
|
||||||
Entity,
|
Entity,
|
||||||
OpType,
|
OpType,
|
||||||
|
|
|
@ -32,7 +32,7 @@ use mentat_core::{
|
||||||
TypedValue,
|
TypedValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
OpType,
|
OpType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub use self::mentat_core::{
|
||||||
ValueType,
|
ValueType,
|
||||||
};
|
};
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
EntityPlace,
|
EntityPlace,
|
||||||
TempId,
|
TempId,
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,7 @@ use mentat_core::{
|
||||||
Schema,
|
Schema,
|
||||||
TypedValue,
|
TypedValue,
|
||||||
};
|
};
|
||||||
use mentat_tx::entities::OpType;
|
use edn::entities::OpType;
|
||||||
use schema::SchemaBuilding;
|
use schema::SchemaBuilding;
|
||||||
|
|
||||||
/// A "Simple upsert" that looks like [:db/add TEMPID a v], where a is :db.unique/identity.
|
/// A "Simple upsert" that looks like [:db/add TEMPID a v], where a is :db.unique/identity.
|
||||||
|
|
|
@ -23,7 +23,7 @@ use mentat_core::{
|
||||||
TypedValue,
|
TypedValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
OpType,
|
OpType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
// The internal data format for transacting is required to encode the complexities of
|
// The internal data format for transacting is required to encode the complexities of
|
||||||
// processing that format: temporary IDs, lookup refs, input spans, etc.
|
// processing that format: temporary IDs, lookup refs, input spans, etc.
|
||||||
//
|
//
|
||||||
// See mentat_tx::entities::Entity and all of its child enums to see how complex this gets.
|
// See edn::entities::Entity and all of its child enums to see how complex this gets.
|
||||||
//
|
//
|
||||||
// A programmatic consumer doesn't want to build something that looks like:
|
// A programmatic consumer doesn't want to build something that looks like:
|
||||||
//
|
//
|
||||||
|
@ -75,7 +75,7 @@ use mentat_db::internal_types::{
|
||||||
TypedValueOr,
|
TypedValueOr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use mentat_tx::entities::{
|
use edn::entities::{
|
||||||
OpType,
|
OpType,
|
||||||
TempId,
|
TempId,
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,6 @@ extern crate mentat_query_pull;
|
||||||
extern crate mentat_query_translator;
|
extern crate mentat_query_translator;
|
||||||
extern crate mentat_sql;
|
extern crate mentat_sql;
|
||||||
extern crate mentat_tolstoy;
|
extern crate mentat_tolstoy;
|
||||||
extern crate mentat_tx;
|
|
||||||
|
|
||||||
pub use mentat_core::{
|
pub use mentat_core::{
|
||||||
Attribute,
|
Attribute,
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "mentat_tx"
|
|
||||||
version = "0.0.1"
|
|
||||||
workspace = ".."
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
[dependencies.edn]
|
|
||||||
path = "../edn"
|
|
|
@ -1 +0,0 @@
|
||||||
This sub-crate implements the core types used by the transaction processor.
|
|
|
@ -1,13 +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.
|
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
|
||||||
#[macro_use] extern crate edn;
|
|
||||||
pub use edn::entities;
|
|
Loading…
Reference in a new issue