adding args for passing order_query and header_icons

pull/143/head
kyoto7250 2 years ago
parent 24756655c3
commit 405de596af

@ -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<String>,
header_icons: Option<Vec<String>>,
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() {

@ -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(())

@ -39,8 +39,10 @@ impl RecordTableComponent {
headers: Vec<String>,
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);
}

@ -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;
}

Loading…
Cancel
Save