Skip to content

Strategies

This page is generated from the PhiSQL spec artifacts for v1.0. Do not edit it by hand; change the artifact and rebuild.

A strategy transforms a detected value. Attach one to a statement with the WITH clause.

REDACT

Replace the detected value with a redaction marker.

Compiles to Phileas strategy REDACT.

Argument Type Required Phileas field
format string no redactionFormat

MASK

Replace the detected value with a repeating mask character.

Compiles to Phileas strategy MASK.

Argument Type Required Phileas field
format string no redactionFormat
mask_char string no maskCharacter
mask_length integer no maskLength

RANDOM_REPLACE

Replace with a randomly chosen synthetic value of the same type.

Compiles to Phileas strategy RANDOM_REPLACE.

Argument Type Required Phileas field
scope enum: DOCUMENT, CONTEXT no replacementScope

STATIC_REPLACE

Replace every match with a fixed value.

Compiles to Phileas strategy STATIC_REPLACE.

Argument Type Required Phileas field
value string yes staticReplacement
scope enum: DOCUMENT, CONTEXT no replacementScope

ENCRYPT

Encrypt the detected value with AES-GCM. Configure the key with "CONFIGURE CRYPTO KEY FROM ENV ''".

Compiles to Phileas strategy CRYPTO_REPLACE.

No arguments.

FPE_ENCRYPT

Format-preserving encryption (e.g., SSNs encrypted but still look like SSNs). Configure the key and tweak with "CONFIGURE FPE KEY FROM ENV '' TWEAK FROM ENV ''".

Compiles to Phileas strategy FPE_ENCRYPT_REPLACE.

No arguments.

HASH_SHA256

Replace with the SHA-256 hash of the detected value.

Compiles to Phileas strategy HASH_SHA256_REPLACE.

No arguments.

LAST_4

Replace all but the last four characters of the detected value.

Compiles to Phileas strategy LAST_4.

No arguments.

TRUNCATE

Truncate the detected value (e.g., dates to year only).

Compiles to Phileas strategy TRUNCATE.

No arguments.

TRUNCATE_TO_YEAR

Truncate a detected date to its year. DATE entities only.

Compiles to Phileas strategy TRUNCATE_TO_YEAR.

No arguments.

SHIFT

Shift a detected date by a fixed offset, or by a random offset when random=TRUE. DATE entities only.

Compiles to Phileas strategy SHIFT.

Argument Type Required Phileas field
days integer no shiftDays
months integer no shiftMonths
years integer no shiftYears
random boolean no shiftRandom

RELATIVE

Replace a detected date with a date expressed relative to the current date. DATE entities only.

Compiles to Phileas strategy RELATIVE.

No arguments.

ABBREVIATE

Reduce the detected value to its initials.

Compiles to Phileas strategy ABBREVIATE.

No arguments.