Commit graph

358 commits

Author SHA1 Message Date
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
Richard Newman
03d8d178fb Add CREDITS file for the icon the add-on uses. 2016-09-22 16:24:37 -07:00
Richard Newman
155f9b6d98 Add Public Domain license to addon code. 2016-09-22 16:24:37 -07:00
Richard Newman
548340c655 Copy the built datomish.js when building the add-on. 2016-09-22 16:24:37 -07:00
Richard Newman
17d7eaec7b Add a babelified test file, Webpack the add-on, and make the JS API work.
We concatenate a simple setTimeout monkeypatch onto the add-on itself.
2016-09-22 15:59:15 -07:00
Richard Newman
360f7622e8 Add handling of simple schemas. Fixes #53. 2016-09-22 15:59:15 -07:00
Richard Newman
bae1cfdc77 Alter release node config to be a bit more human-readable. 2016-09-22 15:59:15 -07:00
Richard Newman
4f37a86039 Use cljify in promise-sqlite. 2016-09-22 15:59:15 -07:00
Richard Newman
ea027e8cea Implement cljify. 2016-09-22 15:59:15 -07:00
Richard Newman
1d53d547b8 Externs. 2016-09-22 12:43:36 -07:00
Richard Newman
330433a45c Add externs file for Node's use of promise_sqlite. 2016-09-22 12:43:35 -07:00
Richard Newman
d178c53dcb Use normal sqlite3 and promise_sqlite. 2016-09-22 12:43:35 -07:00
Richard Newman
77fb997785 Fix source paths. 2016-09-22 12:43:35 -07:00
Nick Alexander
2e9a0f089c Include src/node in global source-paths. r=me
When consuming Datomish from another leiningen project, the .cljs files
need to be included as well.
2016-09-21 13:47:20 -07:00
Nick Alexander
1a30306314 Move datomish.api into exported namespace. 2016-09-19 12:03:09 -07:00
Richard Newman
b5aec2e890 Move src-node and src-browser into subdirectories of src. 2016-09-09 12:07:03 -07:00
Richard Newman
ac253bfea0 Make Datomish work in a Firefox add-on on top of Sqlite.jsm. Fixes #48. r=nalexander 2016-09-09 09:26:19 -07:00
Richard Newman
ee2dca05d0 Add a restartless add-on to load Datomish in Firefox. 2016-09-08 19:11:44 -07:00
Richard Newman
418bb34d57 Add is-node?. 2016-09-08 19:11:44 -07:00
Richard Newman
5ccc725b56 Flesh out JS API. 2016-09-08 19:11:44 -07:00
Richard Newman
d755cd860e Add externs file for Sqlite.jsm. 2016-09-08 19:11:44 -07:00
Richard Newman
97bc90ae30 Add a preload script to set up console.log for browser use as println. 2016-09-08 19:11:44 -07:00
Richard Newman
113cff42aa Add a stub datomish.core for browser code. 2016-09-08 19:11:44 -07:00
Richard Newman
9e4e95ce51 Default SQLite's user_version to zero.
I saw nil here with Sqlite.jsm.
2016-09-08 19:11:44 -07:00