Get Column Metadata
Get Column’s Metadata by ID
You can retrieve the meta details of a single column of a table in the Data Store using the getColumnDetails() SDK method.
The datastore reference used in the following code snippets is the component instance. The table reference used in the below code snippets can either be a table instance or a table meta.
//Use Table Meta Object to get the column with column ID
const datastore = new Datastore();
const table = datastore.table('ShipmentDetails');
const column = await table.getColumnDetails(1510000000110832);
console.log(column);
Example of Expected Response
{
table_id:"2305000000007003",
column_sequence:"5",
column_name:"CityName",
category:2,
data_type:"varchar",
max_length:"100",
is_mandatory:false,
decimal_digits:"2",
is_unique:true,
search_index_enabled:false,
column_id:"2305000000007725"
}
Get a Column’s Metadata by Name
You can pass the name of the required column to the getColumnDetails() SDK method to get its metadata. The column meta will not involve any further operations. Therefore the promise returned here is resolved to a JSON object.
The datastore reference used in the following code snippets is the component instance. The table reference used in the below code snippets can either be a table instance or a table meta.
//Use Table Meta Object to get the column with column ID
const datastore = new Datastore();
const table = datastore.table('SampleTable');
const column = await table.getColumnDetails('newColumn');
console.log(column);
Example of Expected Response
{
table_id:"2305000000007003",
column_sequence:5,
column_name:"CityName",
category:2,
data_type:"varchar",
max_length:100,
is_mandatory:false,
decimal_digits:2,
is_unique:true,
search_index_enabled:false,
column_id:"2305000000007725"
}
Get Metadata of All Columns
You can use the getAllColumns() SDK method to get the metadata of all the columns present in a table in the Data Store.
The datastore reference used in the following code snippets is the component instance. The table reference used in the below code snippets can either be a table instance or a table meta.
//Use Table Meta Object to get all the columns
const datastore = new Datastore();
const table = datastore.table('SampleTable');
const columns = await table.getAllColumns();
console.log(columns);
Example of Expected Response
The promise returned here is resolved into an array of column meta details.
[
{
"table_id": "2136000000007781",
"column_sequence": 1,
"column_name": "ROWID",
"category": 1,
"data_type": "bigint",
"max_length": 50,
"is_mandatory": false,
"decimal_digits": 2,
"is_unique": false,
"search_index_enabled": false,
"column_id": "2136000000007784"
},
{
"table_id": "2136000000007781",
"column_sequence": 2,
"column_name": "CREATORID",
"category": 1,
"data_type": "bigint",
"max_length": 50,
"is_mandatory": false,
"decimal_digits": 2,
"is_unique": false,
"search_index_enabled": true,
"column_id": "2136000000007786"
},
{
"table_id": "2136000000007781",
"column_sequence": 3,
"column_name": "CREATEDTIME",
"category": 1,
"data_type": "datetime",
"max_length": 50,
"is_mandatory": false,
"decimal_digits": 2,
"is_unique": false,
"search_index_enabled": true,
"column_id": "2136000000007788"
},
{
"table_id": "2136000000007781",
"column_sequence": 4,
"column_name": "MODIFIEDTIME",
"category": 1,
"data_type": "datetime",
"max_length": 50,
"is_mandatory": false,
"decimal_digits": 2,
"is_unique": false,
"search_index_enabled": true,
"column_id": "2136000000007790"
},
{
"table_id": "2136000000007781",
"column_sequence": 5,
"column_name": "CityName",
"category": 2,
"data_type": "varchar",
"max_length": 100,
"is_mandatory": false,
"decimal_digits": 2,
"is_unique": true,
"search_index_enabled": true,
"column_id": "2136000000008503"
}
]
Last Updated 2026-07-02 14:51:41 +0530 IST
Yes
No
Send your feedback to us