ankane / blazer

Business intelligence made simple
MIT License
4.5k stars 471 forks source link

[Idea] Smart Columns from another data source #444

Closed kmarsh closed 12 months ago

kmarsh commented 1 year ago

I've been using smart columns for awhile now with one data source. I just pulled in another datasource (Google BigQuery) which works great! But I was wondering... would it be possible to somehow use smart columns that pull data from the main data source when viewing a different one? Perhaps using a YAML syntax like so:

data_sources:
  main:
    url: url: <%= ENV["BLAZER_DATABASE_URL"] %>

    smart_columns:
      user_id: "SELECT id, login FROM users WHERE id IN {value}"

  analytics:
    adapter: bigquery
    smart_columns:
      user_id:
        main: "SELECT id, login FROM users WHERE id IN {value}"

...so queries that have user_id in them in the analytics dataset would pull references from main

ankane commented 12 months ago

Hi @kmarsh, it's not documented / experimental, but you can do:

data_sources:
  analytics:
    inherit_smart_settings: main