-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f62c39c
commit 19ce042
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |