Skip to content

Commit

Permalink
start impl fk constraits in the query chain -- dont like it on the table
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppe-g-gelardi committed Dec 23, 2024
1 parent ee889b7 commit 5cd3432
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/query_operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ pub struct Query {
pub update_data: Option<Value>,
pub row_data: Option<Value>,
}


#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub struct ForeignKeyConstraint {
pub table_name: String,
pub column_name: String,
pub foreign_table_name: String,
pub foreign_column_name: String,
}

4 changes: 2 additions & 2 deletions src/query_operations/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ impl Query {
let mut db = Database::load_from_file(&self.db_file_name)
.await
.map_err(DatabaseError::LoadError)?;
self.handle_execute_add_sync(&mut db).await // Shared logic
self.handle_execute_add(&mut db).await // Shared logic
}

async fn handle_execute_add_sync(&self, db: &mut Database) -> Result<(), DatabaseError> {
async fn handle_execute_add(&self, db: &mut Database) -> Result<(), DatabaseError> {
let table_name = self
.table_name
.clone()
Expand Down

0 comments on commit 5cd3432

Please sign in to comment.