v1.1.0
-
Added
tables
module so that you can use it as a better abstraction to build up your entity changes.use substreams_database_change::tables::Tables; let mut tables = Tables::new(); // Create a row (<entity_name>, <id>).[set(<column>, <value>), ...] tables .create_row("Factory", id) .set("poolCount", &bigint0) .set("txCount", &bigint0) .set("totalVolumeUSD", &bigdecimal0) .set("totalVolumeETH", &bigdecimal0) .set("totalFeesUSD", &bigdecimal0) .set("totalFeesETH", &bigdecimal0) .set("untrackedVolumeUSD", &bigdecimal0) .set("totalValueLockedUSD", &bigdecimal0) .set("totalValueLockedETH", &bigdecimal0) .set("totalValueLockedUSDUntracked", &bigdecimal0) .set("totalValueLockedETHUntracked", &bigdecimal0) .set("owner", &format!("0x{}", Hex(utils::ZERO_ADDRESS).to_string())); // Update a row (<entity_name>, <id>).[set(<column>, <value>), ...] tables .update_row("Bundle", "1").set("ethPriceUSD", &delta.new_value);
-
Add composite primary keys for Protobuf with
oneof
and addpush_change_composite()
tohelpers.rs
. -
Note Changed database protobuf location path from
tosubstreams/sink/database/v1
sf/substreams/sink/database/v1
, this is not a change of the Protobuf package id which is stillsf.substreams.sink.database.v1
. This will have an impact if you usebuf gen --exclude-path
as the path here is the Protobuf original path location, so addsf/
if you were excludingsubstreams/sink/database
. -
GitHub repository has been renamed to
substreams-sink-database-changes
, note the Rust crate's name is stillsubstreams-database-change
to avoid breaking change when importing the crate. We are planning a future rename of the crate, but that might come with a v2 of the data protocol.