Query Syntax

FsPulse provides a flexible, SQL-like query language for exploring scan results. This language supports filtering, custom column selection, ordering, and limiting the number of results.


Query Structure

Each query begins with one of the four supported domains:

  • roots
  • scans
  • items
  • changes

You can then add any of the following optional clauses:

DOMAIN [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]

Column Availability

roots Domain

All queries that retrieve root information begin with the keyword roots:

roots [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
root_idInteger
root_pathPath

scans Domain

All queries that retrieve scan information begin with the keyword scans:

scans [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
scan_idInteger
root_idInteger
stateInteger
is_hashBoolean
hash_allBoolean
is_valBoolean
val_allBoolean
scan_timeDate
file_countInteger
folder_countInteger
addsInteger
modifiesInteger
deletesInteger

items Domain

All queries that retrieve item information begin with the keyword items:

items [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
item_idInteger
scan_idInteger
root_idInteger
item_pathPath
item_typeItem Type Enum
last_scanInteger
is_tsBoolean
mod_dateDate
file_sizeInteger
last_hash_scanInteger
file_hashString
last_val_scanInteger
valValidation Status
val_errorString

changes Domain

All queries that retrieve change history begin with the keyword changes:

changes [WHERE ...] [SHOW ...] [ORDER BY ...] [LIMIT ...]
PropertyType
change_idInteger
root_idInteger
scan_idInteger
item_idInteger
item_pathPath
change_typeChange Type Enum
is_undeleteBoolean
meta_changeBoolean
mod_date_oldDate
mod_date_newDate
hash_changeBoolean
last_hash_scan_oldInteger
hash_oldString
hash_newString
val_changeBoolean
last_val_scan_oldInteger
val_oldValidation Status
val_newValidation Status
val_error_oldString
val_error_newString

The WHERE Clause

The WHERE clause filters results using one or more filters. Each filter has the structure:

column_name:(value1, value2, ...)

Values must match the column’s type. You can use individual values, ranges (when supported), or a comma-separated combination. Values are not quoted unless explicitly shown.

TypeExamplesNotes
Integer5, 1..5, 3, 5, 7..9, null, not null, NULL, NOT NULLSupports ranges and nullability. Ranges are inclusive.
Date2024-01-01, 2024-01-01..2024-06-30, null, not null, NULL, NOT NULLUse YYYY-MM-DD. Ranges are inclusive.
Booleantrue, false, T, F, null, not null, NULL, NOT NULLValues are unquoted. Null values are allowed in all-lower or all-upper case.
String'example', 'error: missing EOF', null, NULLQuoted strings. Null values are allowed in all-lower or all-upper case.
Path'photos/reports', 'file.txt'Must be quoted. Null values are not supported.
Validation StatusV, I, N, U, null, not null, NULL, NOT NULLValid (V), Invalid (I), No Validator (N), Unknown (U). Unquoted. Ranges not supported.
Item Type EnumF, D, null, not null, NULL, NOT NULLFile (F), Directory (D). Unquoted. Ranges not supported.
Change Type EnumA, D, M, null, not null, NULL, NOT NULLAdd (A), Delete (D), Modify (M). Unquoted. Ranges not supported.

Combining Filters

When specifying multiple values within a single filter, the match is logically OR. When specifying multiple filters across different columns, the match is logically AND.

For example:

scans where scan_time:(2025-01-01..2025-01-07, 2025-02-01..2025-02-07), hashing:(T)

This query matches scans that:

  • Occurred in either the first week of January 2025 or the first week of February 2025
  • AND were performed with hashing enabled

The SHOW Clause

The SHOW clause controls which columns are displayed and how some of them are formatted. If omitted, a default column set is used.

You may specify:

  • A list of column names
  • The keyword default to insert the default set
  • The keyword all to show all available columns

Formatting modifiers can be applied using the @ symbol:

item_path@name, mod_date@short

Format Specifiers by Type

TypeAllowed Format Modifiers
Datefull, short
Pathfull, relative, short, name
Validation / Enum / Booleanfull, short
Integer / String(no formatting options)

The ORDER BY Clause

Specifies sort order for the results:

items order by mod_date desc, item_path asc

If direction is omitted, ASC is assumed.


The LIMIT Clause

Restricts the number of rows returned:

items limit 50

Examples

# Items whose path contains 'reports'
items where item_path:('reports')

# Changes involving validation failures
changes where val_new:(I) show default, val_old, val_new order by change_id desc

See also: Interactive Mode · Validators · Configuration