Commit graph

202 commits

Author SHA1 Message Date
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
Brian Grinstead
71a30fe69f Add beginning of web server for the serve subcommand (#159) 2017-01-13 11:46:00 -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
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
7a4c75ba44 Rename to Project Mentat (src). 2017-01-06 17:20:20 -08:00
Brian Grinstead
8a52015422 Take on rusqlite dependency. Fixes #148. r=rnewman 2017-01-06 10:24:04 -06: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
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
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
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
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
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
f5f57da113 Rename datomish.places.import to datomish.places.importer to silence warnings. 2016-11-23 09:02:10 -08:00
Richard Newman
6f006f247d Bump to 0.3.1 to bump a dependency. 2016-11-22 11:40:37 -08:00
Richard Newman
99e7fafd1b Change license to Apache. Fixes #74. 2016-11-22 11:40:37 -08:00
Richard Newman
7df48d0599 Add missing Tufte stub function. 2016-11-17 13:28:54 -08:00
Richard Newman
d568977fa9 Implement schema management proposal. Fixes #95. 2016-11-16 21:04:13 -08:00
Richard Newman
451f13a053 Add :db.schema/version and :db.schema/attribute. 2016-11-16 21:04:13 -08:00
Richard Newman
3212be565c Allow callers to run functions within the scope of a transaction.
This generalizes the transactor loop to allow callers to run
an arbitrary function within an `in-transaction!` body.

Combined with exposing `<report-transact-tx-data!`, this allows
an admittedly sophisticated consumer to conditionally query and
transact in a consistent way -- for example, cleaning up inconsistent
data then transacting a new schema version.
2016-11-16 21:04:13 -08:00
Richard Newman
bd0a56e501 Expose datomish.schema/validate-schema so that schema management can use it. 2016-11-16 21:04:13 -08:00
Richard Newman
5fa26c58a8 Expose id-literal? in the API. 2016-11-16 21:04:13 -08:00
Richard Newman
8e6f8399ae Add <??, a null-safe variant of <?. 2016-11-16 21:04:13 -08:00
Richard Newman
7e50528788 Add repeated-keys utility. 2016-11-16 21:04:13 -08:00
Richard Newman
30023dd939 Move test helpers so they're not included in the built output. 2016-11-16 21:04:12 -08:00
Richard Newman
8ad434574e Remove dependency on Tufte. Fixes #109. 2016-11-16 21:03:59 -08:00
Richard Newman
9d361055d3 Implement schema alteration. Fixes #78.
Altering uniqueness and cardinality attributes works, with the exception
of enabling uniqueness from nothing.

:db/noHistory and :db/isComponent changes are implemented but untested,
and aren't really supported by Datomish anyway.
2016-10-24 20:01:44 -07:00
Richard Newman
46269fe720 Add db.alter/attribute to the bootstrap schema. 2016-10-24 20:01:44 -07:00
Richard Newman
9d81abace5 Implement ident renaming. Fixes #103. 2016-10-24 20:01:44 -07:00
Richard Newman
3cfccc4b81 Implement ground. Fixes #99. 2016-10-19 12:54:05 -07:00
Nick Alexander
3670c5cce7 Review comment: save allocations when evolving. 2016-10-14 10:20:43 -07:00
Nick Alexander
679ab8cf7d Review comment: explain why upserts between generational steps don't conflict. 2016-10-14 10:20:43 -07:00
Nick Alexander
caa9d2d7cb Review comment: prefer dissoc and update to destructuring. 2016-10-14 10:20:43 -07:00
Nick Alexander
00c72f9188 Review comment: fix "Like {...}" map examples. 2016-10-14 10:20:43 -07:00
Nick Alexander
885a816812 Review comment: style nits. 2016-10-14 10:20:43 -07:00
Nick Alexander
39c909ec32 Rewrite resolve-id-literals to use bulk <avs. (#88)
The metaphor we use is that of "evolution", where each "evolutionary
step" contains a number of different "generations".  Entities in the
process of being resolved are increasingly "evolved" into simpler
generations, until no further evolution is possible.
2016-10-14 10:20:43 -07:00
Nick Alexander
1c83287fcf Pre: Make <avs handle fulltext datoms correctly.
The test would fail because we would have an [a v] pair with a string
value, but we were looking for the fulltext rowid in <avs.  Using
all_datoms correctly looks up the string value, at the cost of crippling
the speed of <avs.
2016-10-14 10:20:43 -07:00
Nick Alexander
60c7db4301 Pre: Make testing consistent by sorting fulltext values before inserting.
This sorts fulltext values inserted in a single transaction, not across
transactions.  This makes the rowids assigned in the fulltext_values
table internally consistent, even as the order of entities and datoms
changes (as the transaction applying algorithm evolves over time).  The
test changes simply make the fulltext values sort easily.

In theory, these fulltext values could be very large, and sorting might
be very expensive.  In practice, we expect values to differ in their
first few characters, so that this is efficient (i.e., proportional to
the number of fulltext values inserted and not their size).
2016-10-14 10:20:43 -07:00
Nick Alexander
bc011bbf43 Pre: Add util/group-by-kv. 2016-10-14 10:20:43 -07:00
Richard Newman
feebfd09da Generate known type for the entity in a fulltext expression, and add a test. Fixes #85. 2016-10-13 18:19:29 -07:00
Nick Alexander
a4dd7e4e9c Review comment: make a large-ish dropping buffer for JS listen! consumers. 2016-10-13 16:11:22 -07:00
Nick Alexander
032bfafec2 Review comment: fail pending transactions after closing connection.
This is pretty difficult to test robustly, but here's a stab at it.
2016-10-13 16:11:22 -07:00
Nick Alexander
f02d508370 Review comment: ensure <transact! after <close is rejected. 2016-10-13 16:11:22 -07:00
Nick Alexander
b20c70fc2a Review comment: ensure report is non-nil after in-transaction!. 2016-10-13 16:11:22 -07:00
Nick Alexander
cea0e3d60f Review comment: return pair-chan; accept a result chan and close? flag. 2016-10-13 16:11:22 -07:00
Nick Alexander
e5917406b4 Add {un}listen{-chan}! to connection. (#61) 2016-10-13 16:11:16 -07:00