tables:
  - name: sample_table
    uri: demo/sample_table
    format: delta
  - name: weather
    uri: demo/weather
    format: delta
  - name: invalid_uri_table
    uri: demo/invalid_uri_table
    format: delta

queries:
  - name: all_data
    title: All data
    description: Display all rows from `sample_table` and `weather` tables
    sql: |
      select
        sample_table.*,
        weather.*
      from
        sample_table,
        weather
      limit 10
  - name: daily_avg_temperature
    title: Daily average temperature
    description: Display daily average temperature values from `weather` table
    totals_row: true
    sql: |
      select
        date_trunc('day', time) as day,
        round(avg(temperature_2m)) as avg_temperature
      from
        weather
      group by
        day
      order by
        day asc
  - name: daily_avg_temperature_params
    title: Daily average temperature with parameters
    description: Display daily average temperature values from `weather` table, with dynamic filters for start and end dates
    parameters:
      start_date:
        default: "2025-01-15"
      end_date:
        default: "2025-01-31"
    sql: |
      select
        date_trunc('day', time) as day,
        round(avg(temperature_2m)) as avg_temperature
      from
        weather
      where
        day between $start_date and $end_date
      group by
        day
      order by
        day asc
