Načtení definic sloupců pro tabulku.
const columns = await client.tables.columns("tbl_abc123");
for (const col of columns.data) {
console.log(`${col.key} (${col.type}): ${col.label}`);
}
{
"data": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" },
{ "key": "image_url", "label": "Image", "type": "image" }
]
}
Zobrazit Objekt sloupce
text, number, url, email, date, boolean, richtext, enum, tags, image, images, json.enum.const columns = await client.tables.columns("tbl_abc123");
for (const col of columns.data) {
console.log(`${col.key} (${col.type}): ${col.label}`);
}
{
"data": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" },
{ "key": "image_url", "label": "Image", "type": "image" }
]
}
const columns = await client.tables.columns("tbl_abc123");
for (const col of columns.data) {
console.log(`${col.key} (${col.type}): ${col.label}`);
}
{
"data": [
{ "key": "product_name", "label": "Product Name", "type": "text", "required": true },
{ "key": "price", "label": "Price", "type": "number" },
{ "key": "image_url", "label": "Image", "type": "image" }
]
}