Skip to content

Commit

Permalink
Update fn move_one_table
Browse files Browse the repository at this point in the history
  • Loading branch information
TaQuangKhoi committed Aug 19, 2024
1 parent f62c39c commit 19ce042
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/action/move_data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
pub fn move_one_table() {
println!("move_one_table");
use std::any::Any;
use std::env::var;
use egui::ahash::HashMap;
use crate::action::working_database::{get_cells, get_rows};

pub fn move_one_table(table_name: String) {
let source_database_name = var("POSTGRES_DB_SOURCE").unwrap_or(String::from(""));
let target_database_name = var("POSTGRES_DB_TARGET").unwrap_or(String::from(""));

// STEP 1: Get data of table from source database
let mut data: Vec<HashMap<String, Box<dyn Any>>> = Vec::new();
let source_rows = get_rows(source_database_name, table_name.clone());

let temp_row = source_rows[0].clone();
let temp_cells = get_cells(&temp_row);
println!("Source: {:?}", temp_cells);

// STEP 2: Insert data into target database
}

0 comments on commit 19ce042

Please sign in to comment.