Commit graph

797 commits

Author SHA1 Message Date
Nick Alexander 8725bad18c Pre: Fix error printing rusqlite::Error. 2018-06-30 14:58:23 -07:00
Emily Toop da599c3a78 Fix broken documentation links. (#775) (#767) r=nalexander
* Fix broken API doc links

Create symlink for latest to point to v0.7.
Group APIs by top version number rather than individual

* Update swift and android version numbers to match Mentats

* Update documentation

* Update top level .gitignore to ignore docs site & metatdata

* Add README to help with building documentation site

* Address review comments @ncalexan
2018-06-29 10:28:44 -07:00
Grisha Kruglov 8af5288a60 Use TolstoyError for tolstoy's Results; wrap tolstoy's dependency errors r=nalexander
This is inline with the rest of mentat, and helps with upcoming tolstoy work.
2018-06-29 00:47:19 -04:00
Nick Alexander 5fe4f12d32 Use concrete Mentat error types rather than failure::Error. (#769) r=grisha
In the language of
868273409c/book/src/error-errorkind.md
Mentat is a mid-level API, not an application, and therefore we should
prefer our own error types.  Writing an initial consumer of Mentat (a
Rust logins API targeting Mozilla Lockbox), I have found this to be
true: my consumer wants to consume concrete Mentat error types.

This doesn't go "all the way" and convert all sub-crates to the
Error/ErrorKind, but it does go part of the way.
2018-06-27 15:30:55 -07:00
Nick Alexander ae427849d5 Expose sub-crate *Error types at top-level.
We're not exposing a uniform API with `mentat::Result` yet, meaning
that early consumers (e.g., the logins work for Mozilla Lockbox) need
to wrap errors from all over the Mentat crate hierarchy.
2018-06-27 15:05:43 -07:00
Nick Alexander d31ec28aa8 Patch it all together: use MentatError at top-level.
I elected to keep Tolstoy using `failure::Error`, because Tolstoy
looks rather more like a high-level application (and will continue to
do so for a while) than a production-ready mid- or low-level API.
2018-06-27 15:05:43 -07:00
Nick Alexander ac1b0b15fe Convert query-translator/ to query-projector's ProjectorError. 2018-06-27 15:05:43 -07:00
Nick Alexander b2249f189d Convert query-projector/ to ProjectorError. 2018-06-27 15:05:43 -07:00
Nick Alexander af005a7669 Convert query-algebrizer/ to AlgebrizerError. 2018-06-27 15:05:43 -07:00
Nick Alexander d6569a6a22 Convert query-pull/ to PullError. 2018-06-27 15:05:43 -07:00
Nick Alexander 0e4991fa26 Make db/ use DbErrorKind. 2018-06-27 15:05:43 -07:00
Thom 72a9b302f9
Rename or delete things so that there is only one type named Entid (#768)
* Delete the (apparently unused) EntId

* Rename edn's Entid to EntidOrIdent to avoid confusion with the Entid that's actually an i64

* Fix travis beta bustage (This is actually unrelated to entids, but is a trivial fix nonetheless)
2018-06-26 16:34:18 -07:00
Thom f335253d4c
Fix known leaks and memory safety issues in both swift and android SDKs (#745) 2018-06-25 12:10:11 -07:00
Emily Toop 605c3d938c
Remove duplicated header (#764) 2018-06-25 12:11:58 +01:00
Emily Toop 7232e6ef33
Setting baseurl (#763) 2018-06-25 12:01:16 +01:00
Emily Toop b323448630
Attempting to get minima theme building on github (#762) 2018-06-25 11:56:59 +01:00
Emily Toop 08b83abe21 Set theme jekyll-theme-tactile 2018-06-25 11:21:42 +01:00
Emily Toop c5180656cc
Mentat documentation website using Jekyll (#754)
Steps to building docs locally:

    1. Install Jekyll
    2. cd docs
    3. bundle exec jekyll serve --incremental
    4. open local docs site at http://127.0.0.1:4000/


* basic Jekyll site

* Add docs to documentation site

* Update javadoc to allow for error free builds

* Remove docs for rust dependencies

* Better display examples, about and contributing documentation for Mentat

* Version docs
2018-06-25 11:20:36 +01:00
Nick Alexander 7f76d53612 Load and save CLI history. (#758, #760) r=grisha 2018-06-22 15:39:46 -07:00
Nick Alexander 4ea9c78c50 [cli] Part 3: {load,save}_history as appropriate.
It's possible that we should be saving more aggressively -- perhaps
after each entered command -- but we can add that later.
2018-06-22 15:39:29 -07:00
Nick Alexander c41d728d1d [cli] Part 2: Don't use exit() to terminate the CLI.
It's not possible to do meaningful clean-up (such as saving history)
if we use exit() to quit.  Instead, each handled command returns a
boolean requesting exit.  I elected not to allow ".exit" when
processing commands from the command line; it might be useful to
handle accept that.  In general, though, REPLs that accept "-c
'commands'" on the command line exit after processing those commands,
so I'd rather think more deeply about that model than build in ".exit"
with our existing system.
2018-06-22 15:36:09 -07:00
Nick Alexander c19337c8bf [cli] Part 1: Bump linefeed; use linefeed::Interface; add "--no-tty" argument.
I don't really understand why we were using `linefeed::Reader`
directly, but reading is not the full set of linefeed features we want
to access.  I think the `linefeed::Interface` should be owned by the
`Repl`, not the `InputReader`, but it's a little awkward to share
access with that configuration, so I'm not going to lift the ownership
until I have a reason to.

I think the "--no-tty" argument might be useful for running inside
Emacs.  Along the way, I made read_stdin() strip the trailing newline,
which agrees with InputReader::read_line().
2018-06-22 15:36:09 -07:00
Nick Alexander 8e2d795778
[cli] Handle line comments in EDN input. (#759) (#761) r=grisha
What was happening is that ["[;", "]"] would get glued to "[; ]",
which of course can never complete.

It would be good to add tests of this, but the existing multi-line
`InputReader` makes that challenging and I don't want to invest the
time to improve it: I expect it to be overhauled as part of a
transition away from parsing with `combine` and toward parsing with
`rust-peg`.
2018-06-22 14:34:16 -07:00
Nick Alexander 60a57ea493 Use failure instead of error_chain. (#586) r=nalexander 2018-06-20 14:56:08 -07:00
Nick Alexander 3760f84da8 Post: Fix comment referring to error-chain. 2018-06-20 14:42:39 -07:00
Grisha Kruglov 4e46adeba1 Convert tolstoy/ to failure. 2018-06-20 14:42:36 -07:00
Grisha Kruglov 31de5be64f Convert db/ to failure. 2018-06-20 14:42:34 -07:00
Grisha Kruglov 0adfa6aae6 Convert tools/cli to failure. 2018-06-20 14:42:30 -07:00
Grisha Kruglov 800f404a23 Convert ffi/ to failure.
This is neat, because currently at the FFI boundary we're primarily concerned
with verbalizing our errors. It doesn't matter what 'error' that's wrapped by
Result is then, as long as it can be displayed.

Once we're past the prototyping stage, it might be a good idea to formalize this.
2018-06-20 14:42:21 -07:00
Grisha Kruglov 4e01929334 Convert src/ to failure. 2018-06-20 14:42:18 -07:00
Grisha Kruglov 836fdb3a35 Convert query_translator/ to failure. 2018-06-20 14:42:14 -07:00
Grisha Kruglov c075434f84 Convert query_projector/ to failure. 2018-06-20 14:42:10 -07:00
Grisha Kruglov 061967f268 Convert query-pull/ to failure. 2018-06-20 14:42:05 -07:00
Grisha Kruglov 326fe881a0 Convert query-algebrizer/ to failure. 2018-06-20 14:41:59 -07:00
Grisha Kruglov ce3ce1ccbf Convert sql/ and query-sql/ to failure.
sql/query-sql
2018-06-20 14:41:52 -07:00
Mario Wenzel fb7d2357de Don't try to match "key" when not using sqlcipher. (#752, #753) r=nalexander
This causes a runtime error, since `opt_str("key")` isn't recognized.
2018-06-20 13:26:36 -07:00
Emily Toop aae50f40ac Set theme jekyll-theme-tactile 2018-06-20 15:59:50 +01:00
Emily Toop 4282b2d332 Set theme jekyll-theme-cayman 2018-06-20 15:53:34 +01:00
Nick Alexander 91fa34e462
[website] Create placeholder index.html. 2018-06-19 11:39:08 -07:00
Thom 88c6a4b05c
Fix typo nit accidentally missed in #743 (#744) 2018-06-14 13:30:03 -07:00
Thom 87fb505c56
Make travis test sqlcipher by running the tests on macos. Fixes #738 (#743) 2018-06-14 13:23:17 -07:00
Thom 54d592df29
Merge pull request #742 from thomcc/fix-bustage 2018-06-14 07:58:09 -07:00
Thom Chiovoloni 99a73ccb03 Avoid using 1.26.0-only features when using sqlcipher, and move the sqlcipher Store support to the correct file 2018-06-13 22:48:28 -07:00
Emily Toop 8e918949fb Separate Store from Conn.
This is a Pre: part extracted from #660.
2018-06-13 15:29:11 -07:00
Nick Alexander f041dfe509 Bustage fix: Build against Rust 1.25. 2018-06-13 15:28:44 -07:00
Nick Alexander 8cc0e5a64e Make Travis test against multiple Rust versions, including Rust 1.25. 2018-06-13 15:28:44 -07:00
Thom 6a1a265894
Add support for using sqlcipher (#737). Fixes #118 2018-06-13 08:49:40 -07:00
Emily Toop c0d4568970 Support consumption by Carthage; bump iOS minimum version to 11. r=nalexander
Principally, this adds producing libmentat_ffi.a for consumption by Carthage.

To achieve this, we disable bitcode and bump the miniumum iOS version
to 11.  In addition, we make things open and public so that consumers
can, well, consume.
2018-06-08 13:53:36 -07:00
Nick Alexander 3d5ae797b2 Parse queries with rust-peg. r=rnewman,grisha (#728) 2018-06-04 15:46:13 -07:00
Nick Alexander cfed968514 Review comments. 2018-06-04 15:21:27 -07:00