-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: binary storage db #153
base: master
Are you sure you want to change the base?
Changes from 5 commits
1fbebe9
32f7731
8dceec6
6d9fe73
e6dfe4a
651aafc
2f59b25
ad375ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ fn generate_event_table_sql_with_comments( | |
abi_inputs: &[EventInfo], | ||
contract_name: &str, | ||
schema_name: &str, | ||
binary_mode: bool, | ||
apply_full_name_comment_for_events: Vec<String>, | ||
) -> String { | ||
abi_inputs | ||
|
@@ -53,7 +54,15 @@ fn generate_event_table_sql_with_comments( | |
let event_columns = if event_info.inputs.is_empty() { | ||
"".to_string() | ||
} else { | ||
generate_columns_with_data_types(&event_info.inputs).join(", ") + "," | ||
if binary_mode { | ||
generate_columns_with_data_types(&event_info.inputs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not everything can be stored in bytes like booleans etc we only want to store hex stuff as bytes so i think you need to filter out based on the solidity type which ones to do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we use a .filter() or .filter_map() for this? I'm not sure exactly |
||
.iter() | ||
.map(|column| format!("{} BYTEA", column)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for arrays it has to be BYTEA[] |
||
.collect::<Vec<_>>() | ||
.join(", ") | ||
} else { | ||
generate_columns_with_data_types(&event_info.inputs).join(", ") | ||
} | ||
}; | ||
|
||
let create_table_sql = format!( | ||
|
@@ -160,6 +169,7 @@ pub fn generate_tables_for_indexer_sql( | |
project_path: &Path, | ||
indexer: &Indexer, | ||
disable_event_tables: bool, | ||
binary_mode: bool, | ||
) -> Result<Code, GenerateTablesForIndexerSqlError> { | ||
let mut sql = "CREATE SCHEMA IF NOT EXISTS rindexer_internal;".to_string(); | ||
|
||
|
@@ -185,6 +195,7 @@ pub fn generate_tables_for_indexer_sql( | |
&event_names, | ||
&contract.name, | ||
&schema_name, | ||
binary_mode, | ||
event_matching_name_on_other, | ||
)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add to the docs https://rindexer.xyz/docs/start-building/yaml-config/storage#postgres
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should actually be called "max_optimisation"