{"runtime":"sql","schema_version":1,"generated_at":"2026-07-23T18:31:17.351Z","snippets":[{"id":"aggregate-min-max-avg","title":"Aggregate Min, Max And Average","description":"Compute per-variable statistics on the server instead of fetching raw data","language":"sql","tags":["device","aggregation","average","min","max","group by"],"filename":"aggregate-min-max-avg.sql","file_path":"sql/aggregate-min-max-avg.sql"},{"id":"device-inventory","title":"Device Inventory","description":"List your devices with their type, network, and last activity","language":"sql","tags":["devices","inventory","list","metadata"],"filename":"device-inventory.sql","file_path":"sql/device-inventory.sql"},{"id":"filter-by-variable-and-time","title":"Filter By Variable And Time Window","description":"Read one variable from a device inside a time window using query parameters","language":"sql","tags":["device","data","parameters","filter","time"],"filename":"filter-by-variable-and-time.sql","file_path":"sql/filter-by-variable-and-time.sql"},{"id":"fleet-latest-by-tag","title":"Latest Value Across A Fleet By Tag","description":"Get the newest reading of a variable from every device matching a tag, in one query","language":"sql","tags":["fleet","tags","multiple devices","device_data_by_tag"],"filename":"fleet-latest-by-tag.sql","file_path":"sql/fleet-latest-by-tag.sql"},{"id":"join-two-devices","title":"Correlate Two Devices With A JOIN","description":"Match readings from two devices by time to compare them side by side","language":"sql","tags":["device","join","correlation","multiple devices"],"filename":"join-two-devices.sql","file_path":"sql/join-two-devices.sql"},{"id":"select-latest-device-data","title":"Latest Data From One Device","description":"Read the most recent readings stored on a single device","language":"sql","tags":["device","data","select","basic"],"filename":"select-latest-device-data.sql","file_path":"sql/select-latest-device-data.sql"},{"id":"session-scoped-fleet","title":"Fleet Scoped To The Signed-In User","description":"One stored query that shows each Run user only the devices carrying their own customer tag","language":"sql","tags":["session","run user","fleet","device_data_by_tag","session_user_tag"],"filename":"session-scoped-fleet.sql","file_path":"sql/session-scoped-fleet.sql"},{"id":"session-user-own-device","title":"Latest Data From The Signed-In User's Device","description":"Read recent data from the device tagged with the executing Run user's id","language":"sql","tags":["session","run user","device_tag","session_user_id"],"filename":"session-user-own-device.sql","file_path":"sql/session-user-own-device.sql"}]}