Functions are represented as a string with the following format:
<source>.<namespace>.<func_name>-<arg1>-<arg2>...
-
Function can accept or require arguments.
-
The
source
represent the function origin. Could bepgfilter
,faker
-
namespace: Function category based on the
source
Builtin internal helpfull functions
Replace the current value of the column by NULL
( Postgres representation \N
)
-
Column type:
anything
-
Column must accept
nul
as a valid value -
Example:
{ "public.requests" : { "payload": "pgfilter.default.nul" } }
Replace the current value of the column by an empty string
-
Column type:
varchar/text
-
Column must accept empty strings as valid value
-
Example:
{ "public.requests" : { "encoded_secret": "pgfilter.default.zlen" } }
Replace the current value of the column by an empty array
-
Column type:
array
-
Example:
{ "public.requests" : { "ips": "pgfilter.default.zlar" } }
Evaluate the column value against the dur
argument.
If column value match the duration, the row is allowed
to restore. Otherwise, the whole row is ignored and
won't be included in the restore.
-
Column type:
timestamp
-
Arguments:
-
Example:
For 60 days from now
{ "public.requests" : { "created": "pgfilter.filter.fnow-P60D" // 60 days of duration on the column } }
NOTE fnow
does not support Week duration yet. eg P1W
All the functions on faker.js API are available.
For example:
faker.person.firstName
faker.person.middleName
faker.company.name
faker.number.int
faker.internet.password
For more information. Check faker API methods