sndev.io / docs

get-one

Fetch a single record by query.

The get-one command fetches the first record matching a query and exits with an error if zero or multiple records are found. Use it when exactly one result is expected.
sn get-one <table> <query> [--fields f1,f2]

Fetch a single record by query.

Arguments

NameRequiredDescription
tableYesThe table to query.
queryYesEncoded query that must match exactly one record.

Flags

FlagDefaultDescription
--fields f1,f2Comma-separated list of fields to return.

Examples

sn get-one sys_script_include "name=MyHelper"
{
"sys_id": "abc123",
"name": "MyHelper",
"api_name": "global.MyHelper",
"active": "true"
}