Get Column Metadata
Column metadata details of a single column of a table in the Catalyst Data Store can be retrieved either by using the columnID or the column name.
Get a Column’s Metadata by ID
You can fetch a column’s meta data of a particular table using get_column_details() method. To know more about the component instancedatastore_service and the table instancetable_service used below, please refer to their respective help sections.
Parameters Used
Parameter Name | Data Type | Definition |
---|---|---|
columnID | String | A Mandatory parameter. Will hold the ID of the column for which metadata has to be retrieved. |
copy#Get column's metadata using columnID datastore_service = app.datastore() table_service = datastore_service.table("CITY") column_data = table_service.get_column_details(5249000000032372)
A sample response is shown below :
copy{ table_id: "5249000000011745", 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: "5249000000032372" }
Get a Column’s Metadata by Name
An alternative way to get the meta data of a column is, referring to the column_name. This returns the same response as that of the previous one.
The column meta will not involve any further operations. Therefore, the response is returned here directly. To know more about the component instancedatastore_service and the table instancetable_service used below, please refer to their respective help sections.
Parameters Used
Parameter Name | Data Type | Definition |
---|---|---|
column_name | String | A Mandatory parameter. Will hold the name of the column for which metadata has to be retrieved. |
copy#Get column's metadata using column name datastore_service = app.datastore() table_service = datastore_service.table("CITY") column_data = table_service.get_column_details("CITYNAME")
A sample response is shown below :
copy{ table_id: "5249000000011745", 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
In addition to getting the meta data of a single column, you can retrieve the meta data of all the columns in a particular table using get_all_columns() method. To know more about the component instancedatastore_service and the table instancetable_service used below, please refer to their respective help sections.
copy#Get metadata of all columns datastore_service = app.datastore() table_service = datastore_service.table("CITY") columns = table_service.get_all_columns()
A sample response is shown below :
copy[ { table_id: "5249000000011745", 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: "5249000000011745", 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: "2136000000007785" }, { table_id: "5249000000011745", 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: "2136000000007786" }, { table_id: "5249000000011745", 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: "2136000000007787" }, { table_id: "5249000000011745", 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: "2136000000008588" } ]
Last Updated 2025-03-28 18:24:49 +0530 +0530
Yes
No
Send your feedback to us