Skip to content

Commit 9522559

Browse files
committed
feat: add generic search client traits and adapters
Introduce a family of search client traits with blanket implementations and adapter utilities to reduce boilerplate across backends. New traits ---------- - ItemsClient: single-page item search (search required); defaults: item, items - StreamItemsClient: streaming items across pages (search_stream required); defaults: collect_items, item_count, items_stream - CollectionsClient: fetch all collections (collections required); default: collection point-lookup - PagedCollectionsClient: cursor-paginated collections (collections_page required) for future backends that support paginated /collections - StreamCollectionsClient: streaming collections (collections_stream required); default: collect_collections - ArrowItemsClient (geoarrow feature): Arrow record batch output (search_to_arrow required); default: items_to_arrow - TransactionClient: write operations Blanket implementations ----------------------- - CollectionsClient + Clone + Sync -> StreamCollectionsClient (eager fetch) - ArrowItemsClient + Sync -> ItemsClient + StreamItemsClient (geoarrow feature) Adapter utilities ----------------- - PagedItemsStream<T>: wraps ItemsClient to provide StreamItemsClient via token/skip pagination using ItemCollection::next - stream_pages_generic: free function driving the pagination loop - stream_pages_collections_generic: collections equivalent for PagedCollectionsClient backends - RecordBatchReaderAdapter<I> (geoarrow feature): bridges any Iterator<Item = Result<RecordBatch, E>> to arrow_array::RecordBatchReader Documentation ------------- Add docs/search-clients.md covering the trait family, blanket impls, adapter conversion chart, pagination mechanics, and performance notes.
1 parent 6442b7e commit 9522559

17 files changed

Lines changed: 1355 additions & 121 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ node_modules/
99
package-lock.json
1010
crates/wasm/tests/__screenshots__
1111
.yarn/
12+
planfor*.md

crates/core/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ geoarrow = [
2828
geoparquet = ["geoarrow", "dep:geoparquet", "dep:parquet"]
2929

3030
[dependencies]
31+
async-stream.workspace = true
32+
futures.workspace = true
3133
arrow-array = { workspace = true, optional = true, features = ["chrono-tz"] }
3234
arrow-cast = { workspace = true, optional = true }
3335
arrow-json = { workspace = true, optional = true }
3436
arrow-schema = { workspace = true, optional = true }
3537
bytes.workspace = true
3638
chrono = { workspace = true, features = ["serde"] }
3739
cql2.workspace = true
40+
futures-core.workspace = true
3841
geo = { workspace = true, optional = true }
3942
geo-traits = { workspace = true, optional = true }
4043
geo-types = { workspace = true, optional = true }

0 commit comments

Comments
 (0)