Skip to content

Instantly share code, notes, and snippets.

@wolfieorama
Created April 7, 2016 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfieorama/5a2c06c5ebd9fe8a7f78f39b8ccb80cb to your computer and use it in GitHub Desktop.
Save wolfieorama/5a2c06c5ebd9fe8a7f78f39b8ccb80cb to your computer and use it in GitHub Desktop.
# see https://github.com/ankane/blazer for more info
data_sources:
main:
url: <%= ENV["BLAZER_DATABASE_URL"] %>
# statement timeout, in seconds
# applies to PostgreSQL only
# none by default
# timeout: 15
# time to cache results, in minutes
# can greatly improve speed
# none by default
cache: 60
# wrap queries in a transaction for safety
# not necessary if you use a read-only user
# true by default
# use_transaction: false
smart_variables:
# zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
team_id: "SELECT id, team_code FROM teams ORDER BY team_code ASC"
user_id: "SELECT id, first_name, last_name FROM users"
attendance_id: "SELECT id, created_at FROM attendaces ORDER BY created_at ASC"
attendance_sheet_id: "SELECT id, date FROM attendance_sheets ORDER BY date ASC"
linked_columns:
user_id: "/users/{user_id}"
smart_columns:
user_id: "SELECT id, name FROM users WHERE id IN {value}"
# create audits
audit: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment