Output data transforms
On the check({}) and getContent({}) calls of DepotTest, it is possible to specify an outputFieldNameConvention
parameter to specify what adjustments, if any, should be made to the field names of the returned data.
The outputFieldNameConvention parameter enables you to specify how the field names should be returned.
The following conventions are defined:
| Convention | First-level fields | Nested fields | Notes |
|---|---|---|---|
FieldNameConvention.UPPER_SNAKE_CASE | UPPER_SNAKE_CASE | unchanged (schema property names) | |
FieldNameConvention.UPPER_SNAKE_CASE_DEEP | UPPER_SNAKE_CASE | UPPER_SNAKE_CASE | applied recursively into nested objects |
FieldNameConvention.DATABASE_NATIVE | catalog-reported case | unchanged | Snowflake → uppercase; Aurora → lowercase snake |
FieldNameConvention.DATABASE_NATIVE_DEEP | catalog-reported case | catalog-reported case | applied recursively |
FieldNameConvention.CODE | camelCase | unchanged (schema property names) | |
FieldNameConvention.CODE_DEEP | camelCase | camelCase | applied recursively |
FieldNameConvention.NOOP | as returned by the database | as returned by the database | identical to DATABASE_NATIVE in practice |
FieldNameConvention.DATABASE | UPPER_SNAKE_CASE | unchanged | deprecated alias of UPPER_SNAKE_CASE |
FieldNameConvention.DATABASE_DEEP | UPPER_SNAKE_CASE | UPPER_SNAKE_CASE | deprecated alias of UPPER_SNAKE_CASE_DEEP |
The default is:
UPPER_SNAKE_CASEforcheck({})when the expected data is a fileUPPER_SNAKE_CASEforgetContent({})and forcheck({})when the expected data is supplied inline
The rationale for this is that file-based expected data is typically written in the Snowflake console's
uppercase style, and UPPER_SNAKE_CASE matches that. Programmatic comparisons using inline data objects
follow the same convention for consistency; use CODE or DATABASE_NATIVE if your inline data uses
a different casing.
You can opt out of the defaults at any time by specifying the outputFieldNameConvention parameter.
Use DATABASE_NATIVE when your test must run on both Snowflake and Aurora and you want field names to
always match what the database actually stores, without per-backend adjustments. UPPER_SNAKE_CASE
only matches Snowflake's catalog; CODE doesn't match either backend's catalog. DATABASE_NATIVE
gives you the catalog-correct name on each backend automatically.
Use CODE_DEEP for programmatic testing when you want field names to match the Depot schema convention
(camelCase property names as declared in the schema) rather than any particular database's column
naming. Because CODE_DEEP is derived from the schema source — not from what the database reports —
it is identical on Snowflake and Aurora, making programmatic assertions fully backend-agnostic.