Updates the metadata of the specified table column on a NocoDB server via its
PATCH /api/v2/meta/columns/{id_col} API endpoint.
Beware that this API endpoint always alters the schema of the underlying table, which might be undesirable, especially if the table belongs to an external data source.
Usage
update_tbl_col(
id_col,
column_name = NULL,
title = NULL,
description = NULL,
uidt = NULL,
colOptions = NULL,
dt = NULL,
cdf = NULL,
rqd = NULL,
pk = NULL,
ai = NULL,
au = NULL,
un = NULL,
dtx = NULL,
dtxp = NULL,
dtxs = NULL,
enable_rich_text = NULL,
origin = funky::config_val("origin"),
email = funky::config_val("email"),
password = funky::config_val("password"),
api_token = funky::config_val("api_token"),
quiet = FALSE
)Arguments
- id_col
character(1)
NocoDB column identifier as returned bytbl_col_id().- column_name
character(1)
Column name. Omitted ifNULL.- title
character(1)
NocoDB column title. Omitted ifNULL.- description
character(1)
NocoDB column description displayed as a tooltip in the column header. Omitted ifNULL. Setdescription = ""to remove an existingdescriptionvalue.- uidt
character(1)
NocoDB user interface data type. EitherNULLfor the column's currentuidtvalue or one of"AI""Attachment""AutoNumber""Barcode""Button""Checkbox""Collaborator""Count""CreatedBy""CreatedTime""Currency""Date""DateTime""Decimal""Duration""Email""ForeignKey""Formula""GeoData""Geometry""ID""JSON""LastModifiedBy""LastModifiedTime""Links""LinkToAnotherRecord""LongText""Lookup""MultiSelect""Number""Order""Percent""PhoneNumber""QrCode""Rating""Rollup""SingleLineText""SingleSelect""SpecificDBType""Time""URL""User""Year".
- colOptions
list()
NocoDB column options. To specify the values for a single-select field (uidt = "SingleSelect"), supply a data frame with the columnstitle,color(HEX color code) andindex(counted from 0 upwards) as a list element namedoptions. Defaults to the column's currentcolOptionsvalue ifNULL.- dt
character(1)
Column data type. Omitted ifNULL.- cdf
character(1)
Column default value. Defaults to the column's currentcdfvalue ifNULL. Setcdf = NAto remove an existingcdfvalue.- rqd
logical(1)
Whether or not the column is required to be filled, i.e. should have aNOT NULLconstraint. Corresponds to theNNadvanced field attribute. Defaults to the column's currentrqdvalue ifNULL.- pk
logical(1)
Whether or not the column is a primary key, should have aPRIMARY KEYconstraint. Corresponds to thePKadvanced field attribute. Defaults to the column's currentpkvalue ifNULL.- ai
logical(1)
Whether or not to auto-increment the column value on new record insertion. Corresponds to theAIadvanced field attribute. Defaults to the column's currentaivalue ifNULL.- au
logical(1)
Whether or not to auto-update the column value to the current timestamp on record creation/insertion. Corresponds to theAUadvanced field attribute. Defaults to the column's currentauvalue ifNULL.- un
logical(1)
Whether or not the column is an unsigned number, i.e. can only store non-negative numbers. Corresponds to theUNadvanced field attribute. Defaults to the column's currentunvalue ifNULL.- dtx
Data type x. Defaults to the column's current
dtxvalue ifNULL.- dtxp
Data type x precision. Omitted if
NULL.- dtxs
Data type x scale. Omitted if
NULL.- enable_rich_text
logical(1)
Whether or not to enable rich text support for the column in NocoDB. Only applicable ifuidt = "LongText". Omitted ifNULL.- origin
character(1)
NocoDB server origin.character(1)
E-mail address of the NocoDB user to authenticate with.- password
character(1)
Password of the NocoDB user to authenticate with.- api_token
character(1)
NocoDB API token. Takes precedence overemailandpasswordif provided.- quiet
logical(1)
Whether or not to suppress printing status output from internal processing.
Value
A tibble with metadata about the NocoDB table to which the updated column belongs, invisibly.
See also
Other functions to manage NocoDB table columns:
create_tbl_col(),
delete_tbl_col(),
set_display_val(),
set_display_vals(),
tbl_col(),
tbl_col_id(),
tbl_cols()