diff --git a/src/app.rs b/src/app.rs index 2f3968b..2cab8d8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -162,7 +162,12 @@ impl App { Ok(()) } - async fn update_record_table(&mut self) -> anyhow::Result<()> { + async fn update_record_table( + &mut self, + orders: Option, + header_icons: Option>, + hold_cursor_position: bool, + ) -> anyhow::Result<()> { if let Some((database, table)) = self.databases.tree().selected_table() { let (headers, records) = self .pool @@ -177,10 +182,17 @@ impl App { } else { Some(self.record_table.filter.input_str()) }, + orders, + header_icons, ) .await?; - self.record_table - .update(records, headers, database.clone(), table.clone()); + self.record_table.update( + records, + headers, + database.clone(), + table.clone(), + hold_cursor_position, + ); } Ok(()) } @@ -230,10 +242,15 @@ impl App { .pool .as_ref() .unwrap() - .get_records(&database, &table, 0, None) + .get_records(&database, &table, 0, None, None, None) .await?; - self.record_table - .update(records, headers, database.clone(), table.clone()); + self.record_table.update( + records, + headers, + database.clone(), + table.clone(), + false, + ); self.properties .update(database.clone(), table.clone(), self.pool.as_ref().unwrap()) .await?; @@ -297,6 +314,8 @@ impl App { } else { Some(self.record_table.filter.input_str()) }, + None, + None, ) .await?; if !records.is_empty() { diff --git a/src/components/properties.rs b/src/components/properties.rs index acd6ee4..4e42c18 100644 --- a/src/components/properties.rs +++ b/src/components/properties.rs @@ -77,6 +77,7 @@ impl PropertiesComponent { columns.get(0).unwrap().fields(), database.clone(), table.clone(), + false, ); } self.constraint_table.reset(); @@ -90,6 +91,7 @@ impl PropertiesComponent { constraints.get(0).unwrap().fields(), database.clone(), table.clone(), + false, ); } self.foreign_key_table.reset(); @@ -103,6 +105,7 @@ impl PropertiesComponent { foreign_keys.get(0).unwrap().fields(), database.clone(), table.clone(), + false, ); } self.index_table.reset(); @@ -116,6 +119,7 @@ impl PropertiesComponent { indexes.get(0).unwrap().fields(), database.clone(), table.clone(), + false, ); } Ok(()) diff --git a/src/components/record_table.rs b/src/components/record_table.rs index d4857aa..2f5c84f 100644 --- a/src/components/record_table.rs +++ b/src/components/record_table.rs @@ -39,8 +39,10 @@ impl RecordTableComponent { headers: Vec, database: Database, table: DTable, + hold_cusor_position: bool, ) { - self.table.update(rows, headers, database, table.clone()); + self.table + .update(rows, headers, database, table.clone(), hold_cusor_position); self.filter.table = Some(table); } diff --git a/src/components/sql_editor.rs b/src/components/sql_editor.rs index 50e53cf..b8ad596 100644 --- a/src/components/sql_editor.rs +++ b/src/components/sql_editor.rs @@ -269,7 +269,7 @@ impl Component for SqlEditorComponent { database, table, } => { - self.table.update(rows, headers, database, table); + self.table.update(rows, headers, database, table, false); self.focus = Focus::Table; self.query_result = None; }