Crates.io | substreams-sink-kv |
lib.rs | substreams-sink-kv |
version | 0.1.3 |
source | src |
created_at | 2023-01-10 14:57:20.300365 |
updated_at | 2023-03-22 13:45:19.712477 |
description | Substreams kv sink module |
homepage | https://substreams.streamingfast.io/ |
repository | https://github.com/streamingfast/substreams-database-change |
max_upload_size | |
id | 755453 |
size | 57,494 |
This crate is a simple wrapper around formatting substreams output to a kv store.
// lib.rs
use substreams_sink_kv::pb::kv::KvOperations;
...
pub fn kv_out(
... some stores ...
) -> Result<KvOperations, Error> {
let mut kv_ops: KvOperations = Default::default();
// process your data, push to your KV
kv_ops.push_new(someKey, someValue, ordinal);
kv_ops.push_delete(anotherKey, anotherOrdinal);
Ok(kv_ops)
}