diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 2e049608..4b9c3418 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rindexer_cli" -version = "0.6.0" +version = "0.6.1" edition = "2021" resolver = "2" diff --git a/core/src/api/graphql.rs b/core/src/api/graphql.rs index de7b811d..69c879b1 100644 --- a/core/src/api/graphql.rs +++ b/core/src/api/graphql.rs @@ -113,7 +113,7 @@ pub async fn start_graphql_server( ) }) .collect(); - + let connection_string = connection_string()?; let port = settings.port; let graphql_endpoint = format!("http://localhost:{}/graphql", &port); diff --git a/core/src/database/postgres/generate.rs b/core/src/database/postgres/generate.rs index 77866f9e..302b328d 100644 --- a/core/src/database/postgres/generate.rs +++ b/core/src/database/postgres/generate.rs @@ -4,7 +4,7 @@ use tracing::{error, info}; use crate::{ abi::{ABIInput, ABIItem, EventInfo, GenerateAbiPropertiesType, ParamTypeError, ReadAbiError}, - helpers::{camel_to_snake, to_pascal_case}, + helpers::camel_to_snake, indexer::Indexer, manifest::contract::Contract, types::code::Code, @@ -41,6 +41,7 @@ pub fn generate_column_names_only_with_base_properties(inputs: &[ABIInput]) -> V fn generate_event_table_sql_with_comments( abi_inputs: &[EventInfo], + contract_name: &str, schema_name: &str, apply_full_name_comment_for_events: Vec, ) -> String { @@ -77,9 +78,7 @@ fn generate_event_table_sql_with_comments( // smart comments needed to avoid clashing of order by graphql names let table_comment = format!( "COMMENT ON TABLE {} IS E'@name {}{}';", - table_name, - to_pascal_case(schema_name).as_str(), - event_info.name + table_name, contract_name, event_info.name ); format!("{}\n{}", create_table_sql, table_comment) @@ -178,6 +177,7 @@ pub fn generate_tables_for_indexer_sql( sql.push_str(&generate_event_table_sql_with_comments( &event_names, + &contract.name, &schema_name, event_matching_name_on_other, )); diff --git a/core/src/helpers/mod.rs b/core/src/helpers/mod.rs index 23b13e16..8053e5cd 100644 --- a/core/src/helpers/mod.rs +++ b/core/src/helpers/mod.rs @@ -112,24 +112,6 @@ pub fn replace_env_variable_to_raw_name(rpc: &str) -> String { } } -pub fn to_pascal_case(s: &str) -> String { - let mut result = String::new(); - let mut capitalize_next = true; - - for c in s.chars() { - if c == '_' { - capitalize_next = true; - } else if capitalize_next { - result.push(c.to_ascii_uppercase()); - capitalize_next = false; - } else { - result.push(c.to_ascii_lowercase()); - } - } - - result -} - #[cfg(test)] mod tests { use super::*; @@ -149,24 +131,4 @@ mod tests { assert_eq!(camel_to_snake_advanced("ERC20", false), "erc_20"); assert_eq!(camel_to_snake_advanced("ERC20", true), "erc20"); } - - #[test] - fn test_pascal_case() { - let test_cases = vec![ - ("hello_world", "HelloWorld"), - ("hello", "Hello"), - ("hello__world__test", "HelloWorldTest"), - ("_hello_world", "HelloWorld"), - ("hello_world_", "HelloWorld"), - ("", ""), - ("HELLO_WORLD", "HelloWorld"), - ("hElLo_WoRlD", "HelloWorld"), - ("hello_world_123", "HelloWorld123"), - ("indexer_cdh", "IndexerCdh"), - ]; - - for (input, expected) in test_cases { - assert_eq!(to_pascal_case(input), expected, "Failed for input: {}", input); - } - } } diff --git a/documentation/docs/pages/docs/accessing-data/graphql.mdx b/documentation/docs/pages/docs/accessing-data/graphql.mdx index 627773b5..6aa0cba8 100644 --- a/documentation/docs/pages/docs/accessing-data/graphql.mdx +++ b/documentation/docs/pages/docs/accessing-data/graphql.mdx @@ -182,8 +182,8 @@ in the list results alongside the singular item query. Important to read if you have 2 events with matching names across contracts. ::: -If you have 2 events which have exactly the same name as another contract this is a conflict of naming for graphql and it will render -full naming, for example `Transfer` would turn into `{indexer_name}{contract_name}Transfer`.info +If you have 2 events which have exactly the same name as another contract this is a conflict of naming for graphql so rindexer will render +it as `{contract_name}{event_name}` in pascal case, for example `Transfer` would turn into `{contract_name}Transfer` So its is super clear lets say i had a yaml like this: @@ -222,8 +222,8 @@ contracts: My query names for `allTransfers` would be: -- `AllRocketPoolETHIndexerRocketPoolETHTransfers` -- `AllRocketPoolETHIndexerRocketPoolETHForkTransfers` +- `AllRocketPoolETHTransfers` +- `AllRocketPoolETHForkTransfers` ### Ordering diff --git a/documentation/docs/pages/docs/changelog.mdx b/documentation/docs/pages/docs/changelog.mdx index 3c39875a..a18eafcf 100644 --- a/documentation/docs/pages/docs/changelog.mdx +++ b/documentation/docs/pages/docs/changelog.mdx @@ -9,9 +9,6 @@ ### Bug fixes ------------------------------------------------- -- fix: resolve issue with conflicting event names on graphql meaning it would not load -- fix: resolve filter table names mapping to graphql meaning it would not expose the graphql queries - ### Breaking changes ------------------------------------------------- @@ -20,6 +17,21 @@ all release branches are deployed through `release/VERSION_NUMBER` branches +## 0.6.1-beta - 15th August 2024 + +github branch - https://github.com/joshstevens19/rindexer/tree/release/0.6.1 + +- linux binary - https://rindexer.xyz/releases/linux-amd64/0.6.1/rindexer_linux-amd64.tar.gz +- mac apple silicon binary - https://rindexer.xyz/releases/darwin-arm64/0.6.1/rindexer_darwin-arm64.tar.gz +- mac apple intel binary - https://rindexer.xyz/releases/darwin-amd64/0.6.1/rindexer_darwin-amd64.tar.gz +- windows binary - https://rindexer/releases.xyz/win32-amd64/0.6.1/rindexer_win32-amd64.zip + +### Bug fixes +------------------------------------------------- + +- fix: resolve issue with conflicting event names on graphql meaning it would not load +- fix: resolve filter table names mapping to graphql meaning it would not expose the graphql queries + ## 0.6.0-beta - 8th August 2024 github branch - https://github.com/joshstevens19/rindexer/tree/release/0.6.0 diff --git a/documentation/docs/public/releases/darwin-amd64/0.6.1/rindexer_darwin-amd64.tar.gz b/documentation/docs/public/releases/darwin-amd64/0.6.1/rindexer_darwin-amd64.tar.gz new file mode 100644 index 00000000..213d1c58 Binary files /dev/null and b/documentation/docs/public/releases/darwin-amd64/0.6.1/rindexer_darwin-amd64.tar.gz differ diff --git a/documentation/docs/public/releases/darwin-amd64/rindexer_darwin-amd64.tar.gz b/documentation/docs/public/releases/darwin-amd64/rindexer_darwin-amd64.tar.gz index a014eb30..028e70bc 100644 Binary files a/documentation/docs/public/releases/darwin-amd64/rindexer_darwin-amd64.tar.gz and b/documentation/docs/public/releases/darwin-amd64/rindexer_darwin-amd64.tar.gz differ diff --git a/documentation/docs/public/releases/darwin-arm64/0.6.1/rindexer_darwin-arm64.tar.gz b/documentation/docs/public/releases/darwin-arm64/0.6.1/rindexer_darwin-arm64.tar.gz new file mode 100644 index 00000000..1a3f287f Binary files /dev/null and b/documentation/docs/public/releases/darwin-arm64/0.6.1/rindexer_darwin-arm64.tar.gz differ diff --git a/documentation/docs/public/releases/darwin-arm64/rindexer_darwin-arm64.tar.gz b/documentation/docs/public/releases/darwin-arm64/rindexer_darwin-arm64.tar.gz index 57203f7b..899196a1 100644 Binary files a/documentation/docs/public/releases/darwin-arm64/rindexer_darwin-arm64.tar.gz and b/documentation/docs/public/releases/darwin-arm64/rindexer_darwin-arm64.tar.gz differ diff --git a/documentation/docs/public/releases/linux-amd64/0.6.1/rindexer_linux-amd64.tar.gz b/documentation/docs/public/releases/linux-amd64/0.6.1/rindexer_linux-amd64.tar.gz new file mode 100644 index 00000000..46d44357 Binary files /dev/null and b/documentation/docs/public/releases/linux-amd64/0.6.1/rindexer_linux-amd64.tar.gz differ diff --git a/documentation/docs/public/releases/linux-amd64/rindexer_linux-amd64.tar.gz b/documentation/docs/public/releases/linux-amd64/rindexer_linux-amd64.tar.gz index 7bac10ff..46d44357 100644 Binary files a/documentation/docs/public/releases/linux-amd64/rindexer_linux-amd64.tar.gz and b/documentation/docs/public/releases/linux-amd64/rindexer_linux-amd64.tar.gz differ diff --git a/documentation/docs/public/releases/win32-amd64/0.6.1/rindexer_win32-amd64.zip b/documentation/docs/public/releases/win32-amd64/0.6.1/rindexer_win32-amd64.zip new file mode 100644 index 00000000..ef5f67ef Binary files /dev/null and b/documentation/docs/public/releases/win32-amd64/0.6.1/rindexer_win32-amd64.zip differ diff --git a/documentation/docs/public/releases/win32-amd64/rindexer_win32-amd64.zip b/documentation/docs/public/releases/win32-amd64/rindexer_win32-amd64.zip index 580efcc0..ef5f67ef 100644 Binary files a/documentation/docs/public/releases/win32-amd64/rindexer_win32-amd64.zip and b/documentation/docs/public/releases/win32-amd64/rindexer_win32-amd64.zip differ