mentat/db/src
Emily Toop 8e6f37e709 #260 Convert Schema into edn::Value (#384) r=nalexander, r=rnewman
* Part 1 - Create as_edn_value function.

* Do not include defaults inside output.
* Pretty-printed by default. Do we want to make that a flag?
* Includes simple test just to make sure it works.

* Part 2 - only include ident if available.

* Part 3 - Remove spacing and newlines as unnecessary.

* Update function to build edn::Value directly rather than parsing from string

* Update test to actually test the functionality.

* Address review comments ncalexan.

 * Rename `as_edn_value` to `to_edn_value`.
 * Move `db/src/values.rs` to `core/src/values.rs` so we can reference inside `core/src/ib.rs`.
 * Add `lazy-static` crate to core `Cargo.toml`
 * Expose `values` as a public module from `core`.
 * Update references to values in `db/src/bootstrap.rs` & `db/src/lib.rs`.
 * Add new static vars for `DB_FULLTEXT`, `DB_INDEX` & `DB_IS_COMPONENT`.
 * Use static vars exposed in `values` inside `to_edn_value`.
 * Remove `db/id` as key in attribute output and use `entid` as `db/ident` if no `ident` is found for that `entid`.
 * Update test to match new expected output.

* Add doc comment for function

* Address review comments ncalexan.

* Update function docstring to give clearer description of function.
* Do not all entid at all to output.
* Clean up code fetching ident (make it rustier).

* Address review comments rnewman.

* Extract out to new `to_edn_value` functions code for creating `edn::Value`\'s for `ValueType` and `Attribute`.
* Use `map()` to create schema edn value rather than a loop.

* Address review comments rnewman.

* pass cloned instance of ident to `Attribute::get_edn_value`.
* update `use` import for `edn`.
* remove unnecessary  call when using ident as key on `associate_ident`.

* Fixed bug whereby we didn't differentiate between `db.index/value` and `db.index/identity` when generating `edn::Value`

* Add extra assert at the end to ensure we get the same output when we convert the same schema to edn multiple times

* Move check for type of uniqueness to `match` statement.

* Also use `iter` instead of `into_iter` when iterating schema map.
2017-03-30 11:08:36 +01:00
..
add_retract_alter_set.rs Schema alteration. Fixes #294 and #295. (#370) r=rnewman 2017-03-20 13:18:59 -07:00
bootstrap.rs #260 Convert Schema into edn::Value (#384) r=nalexander, r=rnewman 2017-03-30 11:08:36 +01:00
db.rs Lookup refs, nested vector values, map notation. Fixes #180, fixes #183, fixes #284. (#382) r=rnewman 2017-03-27 16:30:04 -07:00
debug.rs Support transacting :db/fulltext true attributes. Fixes #189. (#375) r=rnewman 2017-03-21 13:12:10 -07:00
entids.rs Schema alteration. Fixes #294 and #295. (#370) r=rnewman 2017-03-20 13:18:59 -07:00
errors.rs Lookup refs, nested vector values, map notation. Fixes #180, fixes #183, fixes #284. (#382) r=rnewman 2017-03-27 16:30:04 -07:00
internal_types.rs Lookup refs, nested vector values, map notation. Fixes #180, fixes #183, fixes #284. (#382) r=rnewman 2017-03-27 16:30:04 -07:00
lib.rs #260 Convert Schema into edn::Value (#384) r=nalexander, r=rnewman 2017-03-30 11:08:36 +01:00
metadata.rs Schema alteration. Fixes #294 and #295. (#370) r=rnewman 2017-03-20 13:18:59 -07:00
schema.rs Add tests for validate_schema_map (#391) r=rnewman 2017-03-30 11:07:49 +01:00
tx.rs Lookup refs, nested vector values, map notation. Fixes #180, fixes #183, fixes #284. (#382) r=rnewman 2017-03-27 16:30:04 -07:00
types.rs Collect tempids after upsert resolution. Fixes #299. (#365) r=rnewman 2017-03-20 11:34:38 -07:00
upsert_resolution.rs Lookup refs, nested vector values, map notation. Fixes #180, fixes #183, fixes #284. (#382) r=rnewman 2017-03-27 16:30:04 -07:00