pysnow.QueryBuilder — Creates a new QueryBuilder object

class pysnow.QueryBuilder[source]

Query builder - used for building complex queries

AND()[source]

And operator

OR()[source]

OR operator

NQ()[source]

NQ (new query) operator

field(field)[source]

Sets the field to operate on

Parameters:field – field (str) to operate on
Returns:self
starts_with(value)[source]

Query records with the given field starting with the value specified

ends_with(value)[source]

Query records with the given field ending with the value specified

contains(value)[source]

Query records with the given field containing the value specified

not_contains(value)[source]

Query records with the given field not containing the value specified

is_empty()[source]

Query records with the given field empty

equals(data)[source]

Query records with the given field equalling either: - the value passed (str) - any of the values passed (list)

not_equals(value)[source]

Query records with the given field not equalling: - the value specified - any of the values specified (list)

greater_than(value)[source]

Query records with the given field greater than the value specified

less_than(value)[source]

Query records with the given field less than the value specified

between(start, end)[source]

Query records in a start and end range

Parameters:
  • startint or datetime object
  • endint or datetime object
Raise:
QueryTypeError:if start or end arguments is of an invalid type
Returns:

self