ankane/blazer

[Idea] Smart Columns from another data source

kmarsh opened this issue · 1 comments

kmarsh commented

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

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

data_sources:
  analytics:
    inherit_smart_settings: main