Skip to main content

Columns

Each column has a data type. The data type constrains the set of possible values that can be assigned to a column and assigns semantics to the data stored in the column so that it can be used for computations. For instance, a column declared to be of a numerical type will not accept arbitrary text strings, and the data stored in such a column can be used for mathematical computations. By contrast, a column declared to be of a character string type will accept almost any kind of data but it does not lend itself to mathematical calculations, although other operations such as string concatenation are available.

Get column

You can either get a single column or a collection of columns.

All columns for a table
GET https://api.centia.io/api/v4/schemas/rockhall/tables/columns HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123
Specific column
GET https://api.centia.io/api/v4/schemas/rockhall/tables/inductees/columns/id HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123

A column object with nested objects looks like this. All properties prefixed with an _ (underscore) is read only. If submitted in a POST or PATCH they will be ignored.

{
"name": "id",
"type": "integer",
"is_nullable": false,
"default_value": null,
"comment": null,
"identity_generation": null,
"_num": 1,
"_full_type": "integer",
"_typname": "int4",
"_is_array": false,
"_character_maximum_length": null,
"_numeric_precision": 32,
"_numeric_scale": 0,
"_max_bytes": 4,
"_reference": null,
"_restriction": null,
"_is_primary": true,
"_is_unique": true,
"_index_method": [
"btree"
],
"_checks": null
}

Properties

  • name: Name of the column.
  • type: The type of the column, such as varchar, integer, boolean, etc.
  • is_nullable: If true, the column can be set to null.
  • default_value: The column is set to the default value if no value is provided.
  • comment: A comment or description for the column.
  • identity_generation: An identity column is a special column generated automatically from an implicit sequence. It can be used to generate key values. Possible values are always or by default.

Add column

Add column in the Centia Web App

Rename, set type, set nullable, set default

You can change name, type, default and nullable of a column or collection of columns.

Edit column properties in the Centia Web App

note

The type of a column can only be changed to a type that is compatible with the existing data.

Delete column

Delete column in the Centia Web App