spetz commented on code in PR #2579:
URL: https://github.com/apache/iggy/pull/2579#discussion_r2703698238
##########
core/connectors/sinks/postgres_sink/src/lib.rs:
##########
@@ -104,43 +178,41 @@ impl PostgresSink {
return Ok(());
}
- let pool = self
- .pool
- .as_ref()
- .ok_or_else(|| Error::InitError("Database not
connected".to_string()))?;
+ let pool = self.get_pool()?;
let table_name = &self.config.target_table;
let include_metadata = self.config.include_metadata.unwrap_or(true);
let include_checksum = self.config.include_checksum.unwrap_or(true);
let include_origin_timestamp =
self.config.include_origin_timestamp.unwrap_or(true);
+ let payload_type = self.payload_format().sql_type();
- let mut create_table_sql = format!("CREATE TABLE IF NOT EXISTS
{table_name} (");
- create_table_sql.push_str("id DECIMAL(39, 0) PRIMARY KEY");
+ let mut sql = format!("CREATE TABLE IF NOT EXISTS {table_name} (");
Review Comment:
Good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]