-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Our backends and our clients are all doing more-or-less the same stuff ... we should abstract those behaviors to a trait or traits.
Initial thoughts (could change, all async
):
SearchClient
:search
is only required method,item
,items
, etc all default to usingsearch
CollectionSearchClient
: same thing but for collectionsTransactionClient
:add
/create
/upsert
items and collections (do we need to separate into aCollectionTransactionClient
?)ArrowSearchClient
:search_to_arrow
iterates over record batches, and provides a default impl ofsearch
that does a conversion (like the DuckDB client does now)
We'll want to update several places to use these traits:
- https://github.com/stac-utils/rustac/tree/main/crates/server/src/backend
- https://github.com/stac-utils/rustac/blob/main/crates/api/src/client.rs
- https://github.com/stac-utils/rustac/blob/main/crates/duckdb/src/client.rs
The traits should live in stac-api.