Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 46fc161

Browse files
author
Emily Toop
authored
Open DB inside CLI (#452) (#463)
* Open named database OR default to in memory database if no name provided Rearrange workspace to allow import of mentat crate in cli crate Create store object inside repl when started for connecting to mentat Use provided DB name to open connection in store Accept DB name as command line arg. Open on CLI start Implement '.open' command to open desired DB from inside CLI * Implement Close command to close current DB. * Closes existing open db and opens new in memory db * Review comment: Use `combine` to parse arguments. Move over to using Result rather than enums with err * Accept and parse EDN Query and Transact commands (#453) (#465) * Parse query and transact commands * Implement is_complete for transactions and queries * Improve query parser. Am still not happy with it though. There must be some way that I can retain the eof() after the `then` that means I don't have to move the skip on spaces and eof Make in process command storing clearer. Add comments around in process commands. Add alternative commands for transact/t and query/q * Address review comments r=nalexander. * Bump rust version number. * Use `bail` when throwing errors. * Improve edn parser. * Remove references to unused `more` flag. * Improve naming of query and transact commands. * Send queries and transactions to mentat and output the results (#466) * Send queries and transactions to mentat and output the results move outputting query and transaction results out of store and into repl * Add query and transact commands to help * Execute queries and transacts passed in at startup * Address review comments =nalexander. * Bump rust version number. * Use `bail` when throwing errors. * Improve edn parser. * Remove references to unused `more` flag. * Improve naming of query and transact commands. * Execute command line args in order * Addressing rebase issues
1 parent 5a6c3f6 commit 46fc161

10 files changed

Lines changed: 817 additions & 55 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ version = "0.4.0"
1111
build = "build/version.rs"
1212

1313
[workspace]
14-
members = []
14+
members = ["tools/cli"]
1515

1616
[build-dependencies]
1717
rustc_version = "0.1.7"
@@ -61,6 +61,3 @@ path = "query-translator"
6161

6262
[dependencies.mentat_tx_parser]
6363
path = "tx-parser"
64-
65-
[dependencies.mentat_cli]
66-
path = "tools/cli"

build/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_version::version_matches;
1616

1717
/// MIN_VERSION should be changed when there's a new minimum version of rustc required
1818
/// to build the project.
19-
static MIN_VERSION: &'static str = ">= 1.15.1";
19+
static MIN_VERSION: &'static str = ">= 1.17.0";
2020

2121
fn main() {
2222
if !version_matches(MIN_VERSION) {

db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mod entids;
4343
pub mod errors;
4444
mod metadata;
4545
mod schema;
46-
mod types;
46+
pub mod types;
4747
mod internal_types;
4848
mod upsert_resolution;
4949
mod tx;

tools/cli/Cargo.toml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "mentat_cli"
33
version = "0.0.1"
4-
workspace = "../.."
54

65
[lib]
76
name = "mentat_cli"
@@ -18,3 +17,29 @@ env_logger = "0.3"
1817
linefeed = "0.1"
1918
log = "0.3"
2019
tempfile = "1.1"
20+
combine = "2.2.2"
21+
lazy_static = "0.2.2"
22+
error-chain = "0.8.1"
23+
24+
[dependencies.rusqlite]
25+
version = "0.11"
26+
# System sqlite might be very old.
27+
features = ["bundled", "limits"]
28+
29+
[dependencies.mentat]
30+
path = "../.."
31+
32+
[dependencies.mentat_parser_utils]
33+
path = "../../parser-utils"
34+
35+
[dependencies.edn]
36+
path = "../../edn"
37+
38+
[dependencies.mentat_query]
39+
path = "../../query"
40+
41+
[dependencies.mentat_core]
42+
path = "../../core"
43+
44+
[dependencies.mentat_db]
45+
path = "../../db"

0 commit comments

Comments
 (0)