Commit graph

324 commits

Author SHA1 Message Date
Jordan Santell 0b87978830 Merge pull request #208 from mozilla/197
Add is_ methods to edn::Value types and add tests. Fixes #197. r=nalexander
2017-01-30 09:37:26 -08:00
Jordan Santell d116fd7bff Add is_$type and as_$type methods to edn::Value types and add tests. Fixes #197 2017-01-30 09:35:33 -08:00
Richard Newman c6fa14c0c8 Rudimentary printing of EDN values. (#209) r=jsantell
* Add a little From helper for edn::parse::ParseError. Not used yet.

* Ignore more things.

* Partly implement Display for edn::Value.
2017-01-28 14:18:17 -08:00
Nick Alexander 506c83c160 Implement basic logging infrastructure. (#205) r=nalexander,victorporof
Signed-off-by: Paul Lange <palango@gmx.de>
2017-01-26 10:43:48 -08:00
Nick Alexander 81af295948 Start installing SQL schema. (#171) r=rnewman
* Start installing the SQLite store and bootstrapping the datom store.

* Review comment: Decomplect V2_IDENTS.

* Review comment: Decomplect V2_PARTS.

* Review comment: Pre: Expose Clojure's merge on Value instances.

* Review comment: Decomplect V2_SYMBOLIC_SCHEMA.

* Review comment: Decomplect V1_STATEMENTS.

* Review comment: Prefer ? to try!.

* Review comment: Fix typos; format; add TODOs.

* Review comment: Assert that Mentat `Schema` is valid upon creation.

* Review comment: Improve conversion to and from SQL values.

This patch factors the fundamental SQL conversion maps
between (rusqlite::Value, value_type_tag) and (edn::Value, ValueType)
through a new Mentat TypedValue.  (A future patch might rename this
fundamental type mentat::Value.)

To make certain conversion functions infallible, I removed
placeholders for :db.type/{instant,uuid,uri}.  (We could panic
instead, but there's no need to do that right now.)

* Review comment: Always uses bundled SQLite in rusqlite.

This avoids (runtime) failures in Travis CI due to old SQLite
versions.  See 432966ac77.

* Review comment: Move semantics in `from_sql_value_pair`.

* Review comment: DB_EXCISE_BEFORE_T instead of ...BEFORET (no underscore).

* Review comment: Move overview notes to the Wiki.
2017-01-25 16:13:56 -08:00
Richard Newman 2592506288 Implement parsing of simple :find expressions. (#196) r=nalexander
* Test the mentat_query directory on Travis.

* Export common types from edn.

This allows you to write

  use edn::{PlainSymbol,Keyword};

instead of

  use edn:🔣:{PlainSymbol,Keyword};

* Add an edn::Value::is_keyword predicate.

* Clean up query, preparing for query-parser.

* Make EDN keywords and symbols take Into<String> arguments.

* Implement parsing of simple :find lists.

* Rustfmt query-parser. Split find and query.

* Review comment: values_to_variables now returns a NotAVariableError on failure.

* Review comment: rename gimme to to_parsed_value.

* Review comment: add comments.
2017-01-25 14:06:19 -08:00
Richard Newman b77d124152 Ignore SQLite wal and shm files. 2017-01-21 19:11:02 -08:00
Nick Alexander ab041291fb edn: Bound values by optional whitespace; treat comma as whitespace. 2017-01-18 08:34:27 -08:00
Nick Alexander 247035cc9b edn: Allow comments.
EDN supports only one type of comment: initiated by ; and lasting
until the end of the current line or the end of the input stream.
2017-01-18 08:34:27 -08:00
Brian Grinstead 71a30fe69f Add beginning of web server for the serve subcommand (#159) 2017-01-13 11:46:00 -08:00
Nick Alexander b11b9b909c Add tx{-parser} crates; start parsing transactions. (#164) r=rnewman
This depends on edn and uses the combine parser combinator library.
2017-01-12 16:08:29 -08:00
Richard Newman a152e60040 Read EDN keywords and symbols as rich types. Fixes #154. r=nalexander 2017-01-12 09:09:48 -08:00
Joe Walker c4735119c4 Implement a basic EDN parser. (#149) r=rnewman,bgrins,nalexander
The parser mostly works and has a decent test suite. It parses all the
queries issued by the Tofino UAS, with some caveats. Known flaws:

* No support for tagged elements, comments, discarded elements or "'".
* Incomplete support for escaped characters in strings and the range of
  characters that are allowed in keywords and symbols.
* Possible whitespace handling problems.
2017-01-11 13:03:04 -08:00
Richard Newman 370742890c Test more things on Travis. (#161) r=bgrins 2017-01-11 11:09:48 -08:00
Richard Newman 71960de636 Add test databases.
* v1empty.db: an empty v1 DB, which is the original on-disk format.
* v2empty.db: an empty v2 DB. This includes bootstrapped schema metadata attributes.
* v1tofino.db: a v1 DB that was created by Tofino.
2017-01-10 12:09:00 -08:00
Brian Grinstead cd9517e5fd Run cargo fmt. r=me 2017-01-10 10:54:37 -08:00
Brian Grinstead 6d10774fc8 Move the bin to src and take on clap dependency for command line arg parsing. Fixes #150. r=rnewman 2017-01-10 10:53:34 -08:00
Richard Newman daddfd3e0f Add query sub-crate, implementing more of the beginnings of the query language. 2017-01-09 12:31:57 -08:00
Richard Newman 476f04e27b Implement a rudimentary Keyword struct and the beginnings of ident/entid. 2017-01-09 12:31:56 -08:00
Richard Newman 22ebcd65f3 Rename everything to Project Mentat. r=bgrins 2017-01-09 09:34:10 -08:00
Richard Newman a54cd9958c Fix Travis. 2017-01-06 17:31:26 -08:00
Richard Newman b9c439bd00 Use underscores for crate names. 2017-01-06 17:31:26 -08:00
Richard Newman a665926fe6 Rename to Project Mentat (query-parser). 2017-01-06 17:20:21 -08:00
Richard Newman 84f468ce41 Rename to Project Mentat (tests). 2017-01-06 17:20:20 -08:00
Richard Newman 3af0d479aa Rename to Project Mentat (cli). 2017-01-06 17:20:20 -08:00
Richard Newman 7a4c75ba44 Rename to Project Mentat (src). 2017-01-06 17:20:20 -08:00
Richard Newman 7f3347981c Rename to Project Mentat (docs). 2017-01-06 17:20:20 -08:00
Richard Newman 76b5a5e43b Rename to Project Mentat (build). 2017-01-06 17:20:20 -08:00
Richard Newman 8f9c532d8d Remove old JS code; we can bring it back if we want it. 2017-01-06 17:20:20 -08:00
Brian Grinstead 981dc6ade9 Ignore .DS_Store files. r=me 2017-01-06 16:07:33 -06:00
Brian Grinstead 8a52015422 Take on rusqlite dependency. Fixes #148. r=rnewman 2017-01-06 10:24:04 -06:00
Richard Newman fa3c99f550 Add a back-pointer to master, because GitHub shows the rust branch by default. 2016-12-21 16:59:26 -08:00
Brian Grinstead 4700eace15 Update README with extra details about using cargo 2016-12-16 18:45:44 -08:00
Brian Grinstead 9b8257a725 Create a new crate for the query parser. Fixes #138. r=rnewman
Starting to work out the project layout for sub-crates.  The crate inside query-parser/ is "datomish-query-parser" and the core code in src/ depends on it.
2016-12-16 18:43:47 -08:00
Brian Grinstead 38e8c49223 Move existing code into js/ subfolder (#137) 2016-12-16 14:31:02 -08:00
Brian Grinstead 5ac47fd6ff Add a stub CLI tool and run tests on it. Fixes #136. r=rnewman 2016-12-16 14:26:10 -08:00
Brian Grinstead f7c97e776c Merge pull request #135 from mozilla/bgrins-patch-1-1
Include instructions for building and testing with cargo
2016-12-16 12:53:54 -08:00
Brian Grinstead 4bebb3cbe4 Include instructions for building and testing with cargo 2016-12-16 11:57:18 -08:00
Brian Grinstead 973c32ff77 Update test boilerplate for running on travis (#134). r=rnewman
* Include a local and external test.
* Add license blocks.
2016-12-16 11:50:08 -08:00
Richard Newman 789eb59c9a Alter Travis config to build Rust. 2016-12-16 10:45:58 -08:00
Richard Newman f8682a65fa Initial Rust commit.
If you want to go fast, go alone. If you want to go far, go together.
2016-12-16 10:39:08 -08:00
Richard Newman cbd278dd7e Remove Clojure and JS application code. 2016-12-16 10:32:23 -08:00
Richard Newman 44d50c9005 Update README for oxidation. 2016-12-16 10:31:06 -08:00
Richard Newman 73f179c887 Strip out Clojure tests and release directories. 2016-12-16 10:30:57 -08:00
Richard Newman 9cc26616a9 Implement unified setup/bootstrapping, bootstrapping new databases in a single transaction. Fixes #125. 0.3.7. 2016-12-16 10:25:17 -08:00
Richard Newman 8e16bee201 Pass existing idents to datoms->schema-fragment, allowing the 'upgrade' of an existing ident to an attribute. 2016-12-16 10:25:17 -08:00
Richard Newman 7cf67474a8 0.3.5. 2016-11-28 18:27:33 -08:00
Richard Newman 9c2978c04e Revert "Bump ClojureScript dependency to 1.9.293." Fixes #122. Version 0.3.3.
This reverts commit 327711bb53.
2016-11-28 17:03:35 -08:00
Richard Newman 103a86f440 Add a :none migration for schema management. Fixes #113. r=grisha
This allows for code to run before and after a schema fragment is
added for the first time.

The anticipated use for this is twofold:

1. To do initial setup, e.g., defining global entities.
2. To 'adopt' unmanaged attributes already defined in the store.

This 'pre' would manually alter or retract attributes so that the
transact of the new schema datoms can complete.

For example, if properties :foo/bar and :foo/baz will be unchanged,
but :noo/zob needs to change from a string to an integer, the :none
pre-function can alter the ident, and the :none post-function can
migrate and clean up.
2016-11-23 17:06:04 -08:00
Richard Newman 7784834fb3 Begin 0.3.3 release. 2016-11-23 17:06:04 -08:00