arrdem / shelving

A toolkit for building data stores.
Eclipse Public License 1.0
38 stars 2 forks source link

Harden the query type inference engine #16

Closed arrdem closed 6 years ago

arrdem commented 6 years ago

A couple of the queries I've tried to infer have enough information but don't infer quite right.

user> (sh/q *conn
  '[:find ?bar
    :in [:from ::foo ?foo]
    :where [[?e ::bar ?bar]
            [?foo ::example ?e]]])
IllegalStateException lvar '?foo' ascribed incompatible specs ':user/foo' and ':shelving.query.analyzer/hole'!  shelving.query.analyzer/put-spec! (analyzer.clj:25)
arrdem commented 6 years ago

It'd be good to write some property based tests which could try to cover all the permutations of partial information to ensure that the type inference engine still works. Just so this sort of thing never crops up again.