centralized system columns - BUG NEEDS FIX FOR SPECIFIC SYSTEM COLUMNS

This commit is contained in:
Priec
2026-08-08 18:58:24 +02:00
parent 8881041740
commit 7db328ca2b
4 changed files with 109 additions and 10 deletions

View File

@@ -10,6 +10,7 @@ use common::proto::komp_ac::search::{
SearchOrderDirection, SearchRequest, SearchResponse, search_response::Hit,
};
use common::search::{SchemaFields, register_tokenizers, search_index_path};
use common::system_column::is_system_column;
use query_builder::{
ConstraintMode, SearchConstraint, SearchConstraintTarget, build_master_query,
};
@@ -536,7 +537,7 @@ fn remap_json_to_display_names(
for (key, value) in object {
let final_key = match physical_to_display.get(&key) {
Some(display_name) => display_name.clone(),
None if is_public_system_column(&key) => key,
None if is_system_column(&key) => key,
None => {
return Err(Status::failed_precondition(
"A table column has no public alias mapping",
@@ -551,13 +552,6 @@ fn remap_json_to_display_names(
}
}
fn is_public_system_column(name: &str) -> bool {
matches!(
name,
"id" | "deleted" | "created_at" | "row_revision" | "account_id"
)
}
/// One value per display column, positionally aligned with them, so a column
/// that is NULL for this row stays visible as an empty slot.
fn row_display_values(value: &serde_json::Value, columns: &[String]) -> Vec<String> {
@@ -613,7 +607,7 @@ async fn resolve_order_column(
.find(|(_, display)| display.eq_ignore_ascii_case(&requested_column))
.map(|(physical, _)| physical.clone())
.or_else(|| {
is_public_system_column(&requested_column).then(|| requested_column.clone())
is_system_column(&requested_column).then(|| requested_column.clone())
})
.ok_or_else(|| {
Status::invalid_argument(format!(