You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let cloned_infra = Infra::clone(infra,db_pool_ref.clone(), name).await?;
280
-
278
+
let cloned_infra = Infra::clone(infra,db_pool.clone(), name).await?;
279
+
letmut conn = db_pool.get().await?;
281
280
for object inObjectType::iter(){
282
281
let model_table = object.get_table();
283
-
let db_pool_ref = db_pool.clone();
284
-
letmut conn = db_pool_ref.get().await?;
285
282
let model = sql_query(format!(
286
283
"INSERT INTO {model_table}(id, obj_id,data,infra_id) SELECT nextval('{model_table}_id_seq'), obj_id,data,$1 FROM {model_table} WHERE infra_id=$2"
287
284
))
@@ -300,8 +297,7 @@ async fn clone(
300
297
"INSERT INTO {layer_table}(id, obj_id,geographic,schematic,infra_id, angle_geo, angle_sch) SELECT nextval('{layer_table}_id_seq'), obj_id,geographic,schematic,$1,angle_geo,angle_sch FROM {layer_table} WHERE infra_id=$2"
0 commit comments