Skip to Content
Isomorphic APIgetColumns

getColumns(lang?: string, params?: GetColumnsParams): Promise<ValidatedColumnInfo[]>

Retrieves columns metadata of the table/view

Parameters

  • lang optional string

    Language code for i18n data. “en” by default

  • params optional GetColumnsParams

    Dynamic/filter based rules (dynamicFields) allow specifying which columns can be updated based on the target record. Useful when the same user can update different fields based on the record state.

    • rule required “update”

      Only “update” is supported at the moment

    • filter required FullFilter

      Filter specifying which records are to be updated

Return type

ValidatedColumnInfo

  • name required string

  • label required string

    Column display name. Will be first non empty value from i18n data, comment, name

  • comment required string | undefined

    Column description (if provided)

  • ordinal_position required number

    Ordinal position of the column within the table (count starts at 1)

  • is_nullable required boolean

    True if column is nullable

  • is_updatable required boolean

  • is_generated required boolean

    If the column is a generated column (converted to boolean from ALWAYS and NEVER)

  • data_type required string

    Simplified data type

  • udt_name required PG_COLUMN_UDT_DATA_TYPE

    Postgres data type name. Array types start with an underscore

  • element_type required string | undefined

    Element data type

  • element_udt_name required string | undefined

    Element data type name

  • is_pkey required boolean

    PRIMARY KEY constraint on column. A table can have a multi column primary key

  • references optional ReferenceTable

  • has_default required boolean

    true if column has a default value Used for excluding pkey from insert

  • column_default optional any

    Column default value

  • character_maximum_length optional number | null | undefined

  • numeric_precision optional number | null | undefined

  • numeric_scale optional number | null | undefined

  • min optional string | number | undefined

    Extracted from tableConfig Used in SmartForm

  • max optional string | number | undefined

  • hint optional string

  • jsonbSchema optional JSONBSchema

    JSONB schema (a simplified version of json schema) for the column (if defined in the tableConfig) A check constraint will use this schema for runtime data validation and apropriate TS types will be generated

  • file optional FileColumnConfig

    If defined then this column is referencing the file table Extracted from FileTable config Used in SmartForm

  • tsDataType required “string” | “number” | “boolean” | “any” | “number[]” | “boolean[]” | “string[]” | “any[]”

    TypeScript data type

  • select required boolean

    Can be viewed/selected Based on access rules and postgres policies

  • orderBy required boolean

    Can be ordered by Based on access rules

  • filter required boolean

    Can be filtered by Based on access rules

  • insert required boolean

    Can be inserted Based on access rules and postgres policies

  • update required boolean

    Can be updated Based on access rules and postgres policies

  • delete required boolean

    Can be used in the delete filter Based on access rules

Last updated on