Skip to content

Commit

Permalink
remove commented dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu committed Nov 22, 2023
1 parent fb92ca2 commit 2f55443
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 92 deletions.
83 changes: 0 additions & 83 deletions core/src/stores/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2156,89 +2156,6 @@ impl Store for PostgresStore {
Ok((tables, total))
}

// async fn upsert_database_row(
// &self,
// project: &Project,
// data_source_id: &str,
// database_id: &str,
// table_id: &str,
// row_id: &str,
// content: &Value,
// ) -> Result<DatabaseRow> {
// let project_id = project.project_id();
// let data_source_id = data_source_id.to_string();
// let database_id = database_id.to_string();
// let table_id = table_id.to_string();

// let pool = self.pool.clone();
// let c = pool.get().await?;

// // get the data source row id
// let stmt = c
// .prepare(
// "SELECT id FROM data_sources WHERE project = $1 AND data_source_id = $2 LIMIT 1",
// )
// .await?;

// let r = c.query(&stmt, &[&project_id, &data_source_id]).await?;
// let data_source_row_id: i64 = match r.len() {
// 0 => panic!("Unknown DataSource: {}", data_source_id),
// 1 => r[0].get(0),
// _ => unreachable!(),
// };

// // get the database row id
// let stmt = c
// .prepare("SELECT id FROM databases WHERE data_source = $1 AND database_id = $2 LIMIT 1")
// .await?;

// let r = c.query(&stmt, &[&data_source_row_id, &database_id]).await?;

// let database_row_id: i64 = match r.len() {
// 0 => panic!("Unknown Database: {}", database_id),
// 1 => r[0].get(0),
// _ => unreachable!(),
// };

// // get the table row id
// let stmt = c
// .prepare(
// "SELECT id FROM databases_tables WHERE database = $1 AND table_id = $2 LIMIT 1",
// )
// .await?;
// let r = c.query(&stmt, &[&database_row_id, &table_id]).await?;
// let table_row_id: i64 = match r.len() {
// 0 => panic!("Unknown Table: {}", table_id),
// 1 => r[0].get(0),
// _ => unreachable!(),
// };

// let row_created = utils::now();

// let row_id = row_id.to_string();
// let row_data = content.to_string();

// // Upsert Database Row.
// let stmt = c
// .prepare(
// "INSERT INTO databases_rows \
// (id, database_table, created, row_id, content) \
// VALUES (DEFAULT, $1, $2, $3, $4, $5) \
// ON CONFLICT (row_id, database_table) DO UPDATE \
// SET content = EXCLUDED.content \
// RETURNING id",
// )
// .await?;

// c.query_one(
// &stmt,
// &[&table_row_id, &(row_created as i64), &row_id, &row_data],
// )
// .await?;

// Ok(DatabaseRow::new(row_created, Some(row_id), content))
// }

async fn load_database_row(
&self,
project: &Project,
Expand Down
9 changes: 0 additions & 9 deletions core/src/stores/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,6 @@ pub trait Store {
database_id: &str,
limit_offset: Option<(usize, usize)>,
) -> Result<(Vec<DatabaseTable>, usize)>;
// async fn upsert_database_row(
// &self,
// project: &Project,
// data_source_id: &str,
// database_id: &str,
// table_id: &str,
// row_id: &str,
// content: &Value,
// ) -> Result<DatabaseRow>;
async fn batch_upsert_database_rows(
&self,
project: &Project,
Expand Down

0 comments on commit 2f55443

Please sign in to comment.