Skip to content

Releases: streamingfast/substreams-sink-database-changes

v2.0.0

16 Oct 19:24
Compare
Choose a tag to compare
  • Bumped dependencies to substreams to 0.6 and prost to 0.13 (see Upgrade notes)

v1.3.1

30 Jan 20:21
Compare
Choose a tag to compare

Maintenance release introducing experimental hidden methods to deal with arrays.

v1.3.0

31 Oct 19:59
Compare
Choose a tag to compare

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() and delete_row() now require a PrimaryKey instead of a String. This should work directly with a String, &String or &str.

v1.2.1

13 Jul 17:47
Compare
Choose a tag to compare
  • Changed imports in substreams.yaml definition so that packaged .spkg can you the expect path sf/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

28 Jun 18:29
Compare
Choose a tag to compare
  • 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

09 Jun 18:28
Compare
Choose a tag to compare
  • Removed some useless dependencies.

v1.1.2

09 Jun 18:24
Compare
Choose a tag to compare
  • Added some missing conversion for ToDatabaseValue trait.

v1.1.1

09 Jun 17:54
Compare
Choose a tag to compare
  • Fixed encoding of Vec<u8> to be in hex 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 on base64 decoding, please let use know and we will find a solution.

v1.1.0

09 Jun 17:31
Compare
Choose a tag to compare
  • 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 add push_change_composite() to helpers.rs.

  • Note Changed database protobuf location path from substreams/sink/database/v1 to sf/substreams/sink/database/v1, this is not a change of the Protobuf package id which is still sf.substreams.sink.database.v1. This will have an impact if you use buf gen --exclude-path as the path here is the Protobuf original path location, so add sf/ if you were excluding substreams/sink/database.

  • GitHub repository has been renamed to substreams-sink-database-changes, note the Rust crate's name is still substreams-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

06 Mar 16:07
Compare
Choose a tag to compare
  • BREAKING Changed database proto package path from substreams.sink.database.v1 to sf.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