Skip to main content

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:

ConventionFirst-level fieldsNested fieldsNotes
FieldNameConvention.UPPER_SNAKE_CASEUPPER_SNAKE_CASEunchanged (schema property names)
FieldNameConvention.UPPER_SNAKE_CASE_DEEPUPPER_SNAKE_CASEUPPER_SNAKE_CASEapplied recursively into nested objects
FieldNameConvention.DATABASE_NATIVEcatalog-reported caseunchangedSnowflake → uppercase; Aurora → lowercase snake
FieldNameConvention.DATABASE_NATIVE_DEEPcatalog-reported casecatalog-reported caseapplied recursively
FieldNameConvention.CODEcamelCaseunchanged (schema property names)
FieldNameConvention.CODE_DEEPcamelCasecamelCaseapplied recursively
FieldNameConvention.NOOPas returned by the databaseas returned by the databaseidentical to DATABASE_NATIVE in practice
FieldNameConvention.DATABASEUPPER_SNAKE_CASEunchangeddeprecated alias of UPPER_SNAKE_CASE
FieldNameConvention.DATABASE_DEEPUPPER_SNAKE_CASEUPPER_SNAKE_CASEdeprecated alias of UPPER_SNAKE_CASE_DEEP

The default is:

  • UPPER_SNAKE_CASE for check({}) when the expected data is a file
  • UPPER_SNAKE_CASE for getContent({}) and for check({}) 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.

tip

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.

tip

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.