currency per column in table definition

This commit is contained in:
Priec
2026-08-03 15:48:21 +02:00
parent 023f8c9dcb
commit 050f93e1fd
16 changed files with 87 additions and 105 deletions

View File

@@ -144,7 +144,6 @@ fn catalog_view(catalog: &GetAnalyticsCatalogResponse) -> CatalogView {
fn catalog_table_view(table: &AnalyticsTable) -> CatalogTableView {
CatalogTableView {
name: table.name.clone(),
base_currency: table.base_currency.clone(),
starter_query: format!("SELECT *\nFROM {}\nLIMIT 100;", quote_identifier(&table.name)),
columns: table
.columns
@@ -157,6 +156,9 @@ fn catalog_table_view(table: &AnalyticsTable) -> CatalogTableView {
if !column.rounding.is_empty() {
details.push_str(&format!(", rounding {}", column.rounding));
}
if !column.currency.is_empty() {
details.push_str(&format!(", currency {}", column.currency));
}
CatalogColumnView {
name: column.name.clone(),
insert_text: quote_identifier(&column.name),
@@ -193,9 +195,6 @@ AVAILABLE ANALYTICS SCHEMA\n",
for table in &catalog.tables {
text.push_str(&format!("\nTABLE {}\n", quote_identifier(&table.name)));
if !table.base_currency.is_empty() {
text.push_str(&format!(" Base currency: {}\n", table.base_currency));
}
text.push_str(" Columns:\n");
for column in &table.columns {
text.push_str(&format!(
@@ -209,6 +208,9 @@ AVAILABLE ANALYTICS SCHEMA\n",
if !column.rounding.is_empty() {
text.push_str(&format!(" [rounding: {}]", column.rounding));
}
if !column.currency.is_empty() {
text.push_str(&format!(" [currency: {}]", column.currency));
}
text.push('\n');
}
if !table.links.is_empty() {

View File

@@ -48,7 +48,6 @@ pub(crate) struct CatalogView {
pub(crate) struct CatalogTableView {
pub name: String,
pub base_currency: String,
pub starter_query: String,
pub columns: Vec<CatalogColumnView>,
pub links: Vec<CatalogLinkView>,