You can execute the DESCRIBE statement to query information about a table, such as the field names and field types.
For more information about the DESCRIBE statement, see Query information about tables.
Prerequisites
A Tablestore client is initialized. For more information, see Initialize a Tablestore client.
Parameters
|
Parameter |
Description |
|
query |
The SQL statement. Configure this parameter based on the required feature. |
Examples
The following sample code provides an example on how to execute the describe test_table statement to query the information about test_table:
const params = {
query: "describe test_table",
}
client.sqlQuery(params, function (err, data) {
if (err) {
console.log('sqlQuery error:', err.toString());
} else {
console.log('sqlQuery success:', data);
}
});
References
-
To use a mapping table to query data that meets specific conditions, execute the
SELECTstatement. For more information, see Query data. -
To update the attribute column of a mapping table after an attribute column of the data table is changed, execute the
ALTER TABLEstatement. For more information, see Update attribute columns of a mapping table. -
To delete a mapping table, execute the
DROP MAPPING TABLEstatement. For more information, see Delete mapping tables.