Releases: streamingfast/substreams-sink-database-changes
v2.0.0
- Bumped dependencies to
substreams
to 0.6 andprost
to 0.13 (see Upgrade notes)
v1.3.1
v1.3.0
Better support for using composite primary keys:
- New enum in this crate:
tables::PrimaryKey
Single(String)
:let single: PrimaryKey = "hello world".into()
Composite(BTreeMap<String, String>)
:let composite: PrimaryKey = [("evt_tx_hash","hello".to_string()),("evt_index","world".to_string())].into()
Breaking changes:
- The
Rows.pks
field is not public anymore. create_row()
,update_row()
anddelete_row()
now require aPrimaryKey
instead of aString
. This should work directly with aString
,&String
or&str
.
v1.2.1
- Changed imports in
substreams.yaml
definition so that packaged.spkg
can you the expect pathsf/substreams/sink/database/v1
to exclude and generating from the.spkg
will generate data on the right path.
If you were using --exclude-paths
on substreams protogen
and your path was database.proto
, you should change to sf/substreams/sink/database/v1
. We think this affects no one has everyone is probably using the pre-rendered Protobuf found in Rust crate substreams-database-change
.
v1.2.0
-
Breaking Renamed
substreams_database_change::pb::database::table_change::Operation::Unset
to be become...::Operation::Unspecified
to make the Protobuf conforms to buf lint rules.We take the liberty to change it because we expect that almost everyone is using the abstraction provided by this library.
v1.1.3
v1.1.2
v1.1.1
- Fixed encoding of
Vec<u8>
to be inhex
format as expected by Postgres (and hopefully other database). This is technically a breaking change but it was probably never actually working, so we are changing. If you were relying onbase64
decoding, please let use know and we will find a solution.
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.
v1.0.0
- BREAKING Changed database proto package path from
substreams.sink.database.v1tosf.substreams.sink.database.v1
c799614 bump version to 1.0.0, move proto package under 'sf.substreams...'
6fc9e64 proto package changed from substreams.database.v1 to substreams.sink.database.v1
184ee5b proto: added go_package option in database.proto
ac9bf50 proto: fix case