sndev.io / docs

exists

Check if a record exists (exit code 0/1).

The exists command checks whether at least one record matches a query and exits with code 0 (found) or 1 (not found). Use it in shell scripts to gate on record existence.
sn exists <table> <query>

Check if a record exists. Exits 0 if found, 1 if not.

Arguments

NameRequiredDescription
tableYesThe table to query.
queryYesEncoded query string.

Examples

sn exists sys_script_include "name=MyHelper" && echo "found"
found