Adventure Labs Logo
Scout Docs

Devices

Table for storing device information including location, type, and configuration

Column NameData TypeConstraints
idbigintNOT NULL
inserted_attimestamp with time zoneDEFAULT timezone('utc'::text, now()) NOT NULL
created_byuuidNOT NULL
herd_idbigintNOT NULL
nametextNOT NULL
descriptiontextNOT NULL
domain_nametext
altitudedouble precision
headingdouble precision
locationextensions.geography(Point,4326)
video_publisher_tokentext
video_subscriber_tokentext
device_typepublic.device_typeDEFAULT 'unknown' NOT NULL
colortext

Security Policies (RLS)

RLS enabled. Herd scope: Herd from devices.herd_id.

Operationhas_herd_ability ability keyOther paths
SELECTdevices.readOwn device API key (id = key_uid()); herd device API keys
INSERTdevices.writeDevice API keys in herd
UPDATEdevices.writeDevice API keys in herd
DELETEdevices.writeDevice API keys in herd

Platform superadmin: FOR ALL bypass where defined.

API keys

load_api_keys(id_of_device) and load_api_keys_batch(device_ids) return a device's API keys and require devices.api_keys.read in the device's herd (admin-only by default), platform superadmin, or the service role; they are not executable signed out.

On this page