Commit graph

15 commits

Author SHA1 Message Date
Richard Newman
70e5759b5f Ensure that variable bindings are used when selecting a table. r=nalexander,etoop
For queries like

```edn
[:find ?x :where [?x _ "hello"]]
[:find [?v ...] :where [_ ?a ?v]]
```

we'll query `all_datoms` to handle fulltext strings, which is expensive.

If `?a` is bound, we can avoid this — resolve any keyword binding,
ensure that the value is an attribute, and use the appropriate table.
2017-03-14 13:47:22 +00:00
Richard Newman
6109a63249 Support input bindings in ConjoiningClauses. r=nalexander 2017-03-10 19:01:56 -08:00
Richard Newman
bf38105fef (#362) Part 4: handle unknown attributes by expanding type codes. r=nalexander
Also, don't run any SQL at all if an algebrized query is known to return no results.
2017-03-08 17:44:27 -08:00
Richard Newman
b5867e9131 (#362) Part 3: implement querying against simple keywords. r=nalexander 2017-03-08 17:44:19 -08:00
Richard Newman
ce3a9bdf87 (#362) Part 2: use constrain_attribute. r=nalexander 2017-03-08 17:44:11 -08:00
Richard Newman
8935d6a8a5 (#362) Part 1: if a variable's type becomes known, don't extract it. r=nalexander
This is necessary because we process patterns sequentially; a later
pattern might tell us the type of a variable (e.g., by having a
constant attribute), at which point we can do less work.
2017-03-08 17:44:00 -08:00
Richard Newman
e898df8842 Implement basic query limits. (#361) r=nalexander 2017-03-08 17:41:42 -08:00
Richard Newman
70b112801c Implement projection and querying. (#353) r=nalexander
* Add a failing test for EDN parsing '…'.
* Expose a SQLValueType trait to get value_type_tag values out of a ValueType.
* Add accessors to FindSpec.
* Implement querying.
* Implement rudimentary projection.
* Export mentat_db::new_connection.
* Export symbols from mentat.
* Add rudimentary end-to-end query tests.
2017-03-06 14:40:10 -08:00
Richard Newman
91c75f26c8 Expand query algebrizer. r=nalexander 2017-02-23 18:39:49 -08:00
Joe Walker
60b2e6f885 Improve Debug output for ConjoiningClauses; r=rnewman
Fixes #317, and also removes the '::' exploration of rust style
2017-02-23 14:05:56 +00:00
Richard Newman
a10f68fdb7 Mark every project as being part of the workspace. r=nalexander
This allows `cargo test --all` to work.
2017-02-20 11:04:08 -08:00
Richard Newman
a9cd9b1e87 Export symbols and string helpers from mentat_query_algebrizer. 2017-02-17 17:54:07 -08:00
Jordan Santell
a59f9583ac Store Idents as NamespacedKeywords, rather than Strings. Fixes #291. (#300)
r=ncalexander
2017-02-17 13:55:36 -08:00
Richard Newman
5af7082165 Partly flesh out query algebrizer. (#243) r=nalexander 2017-02-15 16:10:59 -08:00
Richard Newman
42f03f55a2 Stub out query algebrizer. 2017-02-15 16:01:22 -08:00