A-transactenhancementhelp wantedhygiene
仓库指标
- Star
- (1,661 star)
- PR 合并指标
- (PR 指标待抓取)
描述
For simplicity, in #214 I only handled namespaced keywords, like :namespaced/keyword. However, the transactor and query engine can and should handle non-namespaced keywords, like :keyword. This ticket tracks adding support for such keywords.
This ticket is similar to #201, but a little simpler and potentially a little longer, since there are no new :db.type/* definitions and no new ValueType. You'll need to:
- Add a new
TypedValuecase, preferably by encapsulating the two types of keywords into oneenum Keyword { NamespacedKeyword(...), Keyword(...) }; - Implement the conversions to and from SQL, using the facts that:
- the SQL
TEXTrepresentation of ":namespaced/keyword" and ":keyword" doesn't overlap; - the value type tag of namespaced and non-namespaced keywords is the same (tag 13)
- Add tests for conversion around https://github.com/mozilla/mentat/blob/1deed24f42847bc1eb0cfc26bada840643eaec33/db/tests/value_tests.rs#L25.
- Update the transactor to handle the two types of keywords as required -- start by generalizing
to_namespaced_keywordto handle both types of keyword (around https://github.com/mozilla/mentat/blob/1deed24f42847bc1eb0cfc26bada840643eaec33/db/src/lib.rs#L42) - Add tests of the new types in the transactor and potentially in the query engine as well.