Skip to content

Commit bd02edb

Browse files
committed
Debugging bulk_insert_or_replace
1 parent 6c338d3 commit bd02edb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

my-no-sql-data-writer/src/my_no_sql_data_writer/execution.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,22 @@ pub async fn bulk_insert_or_replace<
118118
return Ok(());
119119
}
120120

121+
let mut debug_data = String::new();
122+
121123
let response = flurl
122124
.append_path_segment(BULK_CONTROLLER)
123125
.append_path_segment("InsertOrReplace")
124126
.append_data_sync_period(sync_period)
125127
.with_table_name_as_query_param(TEntity::TABLE_NAME)
126-
.post(serialize_entities_to_body(entities))
128+
.post_with_debug(serialize_entities_to_body(entities), &mut debug_data)
127129
.await?;
128130

131+
if debug_data.len() > 1024 {
132+
println!("Debug Data: {}", &debug_data[..1024]);
133+
} else {
134+
println!("Debug Data: {}", debug_data);
135+
}
136+
129137
if is_ok_result(&response) {
130138
return Ok(());
131139
}

0 commit comments

Comments
 (0)