Commit graph

431 commits

Author SHA1 Message Date
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 d94dfae01b Pre: Add multistep upsert example. 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 8bb0dcfa2e Upgrade honeysql to org.clojars.rnewman/honeysql 0.8.2 to fix UNION parenthesizing. Fixes #83. 2016-10-14 10:19:15 -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 445364f192 Bump to version 0.1.2-SNAPSHOT. 2016-10-13 16:30:16 -07:00
Nick Alexander ed545d4a11 Serialize <transact!; add {un}listen{-chan}!. r=rnewman (#61, #80) 2016-10-13 16:29:24 -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
Nick Alexander a8ad79d0e6 Make <transact! run in a critical section. (#80) 2016-10-11 20:32:35 -07:00
Nick Alexander 2081ca4563 Pre: Add unlimited-buffer and unblocking-chan?. 2016-10-11 20:32:35 -07:00
Nick Alexander e1b1abe2de Pre: clarify comments. 2016-10-11 20:32:35 -07:00
Nick Alexander a89224673a Pre: Standardize util-test file location.
This is the "standard" Clojure layout, and makes the testing integration
in Emacs CIDER happy.
2016-10-11 20:04:57 -07:00
Richard Newman 15b0f63d99 Update README for local cljs install. 2016-10-11 11:46:13 -07:00
Richard Newman 0789219551 Add order-by exercising to the JS test script. 2016-10-07 20:12:17 -07:00
Richard Newman c36be57018 Expose a 'tempid' function on transaction results, because JS object lookup doesn't work for TempIds. 2016-10-07 20:12:17 -07:00
Richard Newman 5b6000003d Support order-by query option from JS. 2016-10-07 20:12:17 -07:00
Richard Newman b8a3f5fe2b Use scalar and collection find specs in tests.js. 2016-10-07 12:03:17 -07:00
Richard Newman f775e67912 Add a test for long strings round-tripping through node-sqlite3. Fixes #65. 2016-10-07 11:58:50 -07:00
Richard Newman e89544beba Implement all four find specs. Fixes #38. r=nalexander 2016-10-07 11:02:35 -07:00
Richard Newman e7add97a67 Minor README tweaks. 2016-10-06 15:26:37 -07:00
Richard Newman f930d1312a Improve ClojureScript->JavaScript roundtripping, and flesh out example Node test. 2016-10-05 16:41:12 -07:00
Richard Newman 021f2be620 Review comment: add comment about cljify. 2016-10-05 14:07:07 -07:00
Richard Newman 61757e271c Review comment: use datomish.api where possible. 2016-10-05 14:06:36 -07:00
Richard Newman ce67644fd5 Part 3: expand example Node code. 2016-10-05 12:54:48 -07:00
Richard Newman c7d0a8596b Part 2: extend 'cljify' implementation to round-trip records like TempId. 2016-10-05 12:54:26 -07:00
Richard Newman 0b6ac81ed5 Part 1: extend 'db' JS object with more useful methods. 2016-10-05 12:53:57 -07:00
Richard Newman b777445ebf Sort variable sets to make tests consistent across platforms. 2016-10-04 11:38:14 -07:00
Nick Alexander 1fe0cbeaf0 Improve lookup-ref correctness and performance; reduce in-DB garbage. r=rnewman
Before, the parts of the lookup-ref test that passed took about ~2100ms
on my device.  After, the entire lookup-ref test takes 350ms, a
significant speed-up.  I did not try to plot the graphs of the two
approaches as the number of lookup-refs increased, since the new
approach is significantly better in all cases I can think of.
2016-09-30 17:00:54 -07:00
Nick Alexander 3cd64fb4d8 Review comments. 2016-09-30 17:00:27 -07:00
Nick Alexander 611d44fcce Process lookup-refs in batches. Fixes #25.
This uses a common table expression and multiple SQL calls rather than a
temporary table, since transactions with huge numbers of distinct
lookup-refs are likely to be very rare.

We mark lookup-refs with `lookup-ref`, which is a little awkward because
binding `(let [[a v] lookup-ref] ...)` doesn't directly work, but avoids
some ambiguity present in Datomic and DataScript around interpreting
lookup-refs as multiple value lists.  (Which bit the tests in an earlier
version of this patch!)
2016-09-30 16:47:04 -07:00
Nick Alexander 20531c1789 Pre: Don't insert nil tx where it should not be. 2016-09-30 16:47:04 -07:00
Nick Alexander c46f0eb8ae Part 2: Get rid of {0, 1} -> {2, 3} mapping for added/added0. Fixes #28.
Now that we copying from tx_lookup_before -> tx_lookup_after, we don't
need to avoid duplicating rows.
2016-09-30 16:47:04 -07:00
Nick Alexander da1250d210 Part 1: Separate tx_lookup into tx_lookup_before and tx_lookup_after. 2016-09-30 16:47:04 -07:00
Richard Newman a7d6a37cfc Update comment in cc.cljc. 2016-09-29 15:49:30 -07:00
Richard Newman 6ab93208cb Part 2: implement complex 'or' translation. Fixes #57. r=nalexander
We implement sql-projection-for-simple-variable-list to allow us to add
a projection to subqueries.
2016-09-29 15:46:15 -07:00
Richard Newman b9b9c37dfa Part 1: pass in :select when creating a partial subquery from a CC. 2016-09-29 15:44:16 -07:00
Richard Newman 1296b8090f Allow sets of attributes in fulltext expressions. Fixes #54. r=nalexander 2016-09-26 16:34:37 -07:00
Richard Newman 32cd08ba13 Add more build instructions to the README. 2016-09-22 16:50:59 -07:00
Richard Newman 8dd15244fa Update README. 2016-09-22 16:45:52 -07:00
Richard Newman d6c074830f Implement a JS interface for Datomish, demonstrating it with a small Firefox add-on. Fixes #53. r=nalexander 2016-09-22 16:42:18 -07:00
Richard Newman 9587311412 Include deps.cljs giving externs for Node.js consumers; normalize build output.
cljsbuild using leiningen projects that depend on Datomish will
automatically include the externs.
2016-09-22 16:24:37 -07:00
Richard Newman d0a04a5e56 Review comment: extracted shared go-promise. 2016-09-22 16:24:37 -07:00