This commit is contained in:
Priec
2026-08-18 11:46:34 +02:00
parent a8877e4418
commit 22361d0dde
7 changed files with 24 additions and 23 deletions

View File

@@ -31,6 +31,7 @@ const HARD_RESULT_LIMIT: usize = 200;
const DEFAULT_LIST_LIMIT: usize = 5;
const SEARCH_SCORE_RELATIVE_FLOOR: f32 = 0.25;
const SEARCH_SCORE_GROUP_WIDTH: f32 = 0.25;
const LEDGER_ACCOUNTS_TABLE_NAME: &str = "ledger_accounts";
pub struct AccountPathProjection {
paths: HashMap<i64, String>,
@@ -48,7 +49,7 @@ impl AccountPathProjection {
let account_column = physical_to_display
.get(common::system_column::ACCOUNT_REFERENCE_COLUMN)
.cloned();
let accounts_table = table_name == "accounts";
let accounts_table = table_name == LEDGER_ACCOUNTS_TABLE_NAME;
if account_column.is_none() && !accounts_table {
return Ok(Self {
paths: HashMap::new(),
@@ -58,8 +59,9 @@ impl AccountPathProjection {
}
let qualified_accounts = format!(
"\"{}\".\"accounts\"",
"\"{}\".\"{}\"",
profile_name.replace('"', "\"\""),
LEDGER_ACCOUNTS_TABLE_NAME,
);
let rows = sqlx::query(AssertSqlSafe(format!(
"SELECT id, segment, parent_account_id FROM {qualified_accounts} WHERE deleted = FALSE"