pub struct Tables {
pub tables: HashMap<String, Rows>,
}
Fields§
§tables: HashMap<String, Rows>
Implementations§
Source§impl Tables
impl Tables
pub fn new() -> Self
Sourcepub fn create_row<K: Into<PrimaryKey>>(
&mut self,
table: &str,
key: K,
) -> &mut Row
pub fn create_row<K: Into<PrimaryKey>>( &mut self, table: &str, key: K, ) -> &mut Row
Create a new row in the table with the given primary key.
// With a Primary Key of type `Single`
use crate::substreams_database_change::tables::Tables;
let mut tables = Tables::new();
tables.create_row("myevent", "my_key",);
// With a Primary Key of type `Composite`
use crate::substreams_database_change::tables::Tables;
let mut tables = Tables::new();
tables.create_row("myevent", [("evt_tx_hash", String::from("hello")), ("evt_index", String::from("world"))]);
pub fn update_row<K: Into<PrimaryKey>>( &mut self, table: &str, key: K, ) -> &mut Row
pub fn delete_row<K: Into<PrimaryKey>>( &mut self, table: &str, key: PrimaryKey, ) -> &mut Row
pub fn to_database_changes(self) -> DatabaseChanges
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tables
impl RefUnwindSafe for Tables
impl Send for Tables
impl Sync for Tables
impl Unpin for Tables
impl UnwindSafe for Tables
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more