← Back to Stormify Documentation

addFacet

fun addFacet(alias: String, vararg fieldPaths: String): Facet

Adds a filter/sort column under alias with one or more field paths. The column type is auto-detected from the first path's Kotlin type. Multiple paths use OR logic during filtering (e.g., a single "search" column that matches any of several fields).

Aliases are the only column identifier visible outside the server — they must not leak schema details. Prefer short, human-readable business names ("name", "total").


fun addFacet(alias: String, type: Facet.Type, vararg fieldPaths: String): Facet

Explicit-type variant of addFacet.


fun addFacet(alias: String, enumValues: Map<String, Any>, vararg fieldPaths: String): Facet

Enum-column variant of addFacet with an explicit display→DB value map.


fun addFacet(alias: String, vararg paths: ScalarPath): Facet

Adds a column using type-safe KSP-generated path objects.


fun addFacet(alias: String, type: Facet.Type, vararg paths: ScalarPath): Facet

Explicit-type typed-path variant.


fun addFacet(alias: String, enumValues: Map<String, Any>, vararg paths: ScalarPath): Facet

Enum-column typed-path variant.