Support transacting :db/fulltext true attributes. Fixes #189.#375
Conversation
|
|
||
| /// Insert search rows into temporary search tables. | ||
| /// | ||
| /// Eventually, the details of this approach will be captured in |
|
|
||
| let chunks: itertools::IntoChunks<_> = entities.into_iter().chunks(max_vars / bindings_per_statement); | ||
|
|
||
| // We'd like to flat_map here, but it's not obvious how to flat_map across Result. |
There was a problem hiding this comment.
I think collect has automatic conversions for Vec<Result<T>> to Result<Vec<T>>, if that helps.
There was a problem hiding this comment.
I don't think it does. We want to flat_map a bunch of Result<Iter> into Result<Iter>. I guess it's a fold with .chain(), but that's no more clear than this pattern.
| // We must keep these computed values somewhere to reference them later, so we can't | ||
| // combine this map and the subsequent flat_map. | ||
| // (e0, a0, v0, value_type_tag0, added0, flags0) | ||
| let block: Result<Vec<(i64 /* e */, |
There was a problem hiding this comment.
Entid? Or are you sticking to raw types to emphasize SQLness?
| u8 /* flags0 */, | ||
| i64 /* searchid */)>> = chunk.map(|&(e, a, ref attribute, ref typed_value, added)| { | ||
| if typed_value.value_type() != ValueType::String { | ||
| bail!("TODO"); |
There was a problem hiding this comment.
Oh! This was just overlooked; I'll add an error message.
| use tabwriter::TabWriter; | ||
|
|
||
| use bootstrap; | ||
| use db::TypedSQLValue; |
There was a problem hiding this comment.
I think you've interleaved modules and crates here…
There was a problem hiding this comment.
No, these are all modules. Or do you want all use module; before any use module::symbol? I've been interleaving them.
There was a problem hiding this comment.
I mean: you have use mentat_core::… below here, followed by use types::Schema. Rather than:
extern crate …;
use third_party_library::…;
use mentat_foo::…;
use mentat_bar::…;
use samecratemodule_a::…;
use samecratemodule_b::…;
you've interleaved them.
There was a problem hiding this comment.
I haven't been separating out mentat_* from samecratemodule_*. I can start doing that.
These tests are direct translations of the Clojure tests.
This builds on #370, so be sure to look at that first.