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 existingdescription
value.- uidt
character(1)
NocoDB user interface data type. EitherNULL
for the column's currentuidt
value 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 currentcolOptions
value ifNULL
.- dt
character(1)
Column data type. Omitted ifNULL
.- cdf
character(1)
Column default value. Defaults to the column's currentcdf
value ifNULL
. Setcdf = NA
to remove an existingcdf
value.- rqd
logical(1)
Whether or not the column is required to be filled, i.e. should have aNOT NULL
constraint. Corresponds to theNN
advanced field attribute. Defaults to the column's currentrqd
value ifNULL
.- pk
logical(1)
Whether or not the column is a primary key, should have aPRIMARY KEY
constraint. Corresponds to thePK
advanced field attribute. Defaults to the column's currentpk
value ifNULL
.- ai
logical(1)
Whether or not to auto-increment the column value on new record insertion. Corresponds to theAI
advanced field attribute. Defaults to the column's currentai
value ifNULL
.- au
logical(1)
Whether or not to auto-update the column value to the current timestamp on record creation/insertion. Corresponds to theAU
advanced field attribute. Defaults to the column's currentau
value ifNULL
.- un
logical(1)
Whether or not the column is an unsigned number, i.e. can only store non-negative numbers. Corresponds to theUN
advanced field attribute. Defaults to the column's currentun
value ifNULL
.- dtx
Data type x. Defaults to the column's current
dtx
value 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 overemail
andpassword
if 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()