Python
import os
from meibel import MeibelClient
from meibel.models import UpdateTagColumnsRequest, TagColumnUpdateItem
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_columns = client.datasources.tables.update_column_descriptions(
"ds_9f2a1c7b",
"customer_orders",
body=UpdateTagColumnsRequest(
columns=[
TagColumnUpdateItem(
column_name="order_id",
description="Unique identifier for each customer order",
),
TagColumnUpdateItem(
column_name="total_amount",
description="Total order value in USD, including tax",
),
]
),
)
for column in updated_columns:
print(f"{column.column_name}: {column.description}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const columns = await client.datasources.tables.updateColumnDescriptions(
"ds_abc123",
"customers",
{
columns: [
{
column_name: "customer_id",
description: "Unique identifier for the customer record",
},
{
column_name: "signup_date",
description: "Date the customer created their account",
},
],
}
);
console.log(`${columns[0].column_name}: ${columns[0].description}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
columns, err := client.Datasources.Tables.UpdateColumnDescriptions(
context.Background(),
"ds_9f8a7b6c5d4e",
"customer_orders",
v2.UpdateTagColumnsRequest{
Columns: []v2.TagColumnUpdateItem{
{
ColumnName: "order_id",
Description: "Unique identifier for each customer order",
},
{
ColumnName: "order_total",
Description: "Total order amount in USD, including tax and shipping",
},
},
},
)
if err != nil {
fmt.Println("error:", err)
return
}
for _, col := range columns {
fmt.Printf("%s (%s): %s\n", col.ColumnName, col.Type, col.Description)
}
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"columns": [
{
"column_name": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({columns: [{column_name: '<string>', description: '<string>'}]})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'columns' => [
[
'column_name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"column_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": [\n {\n \"column_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"column_name": "<string>",
"type": "<string>",
"description": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Tables
Update Column Descriptions
PUT
/
datasources
/
{datasource_id}
/
tables
/
{table_name}
/
columns
Python
import os
from meibel import MeibelClient
from meibel.models import UpdateTagColumnsRequest, TagColumnUpdateItem
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
updated_columns = client.datasources.tables.update_column_descriptions(
"ds_9f2a1c7b",
"customer_orders",
body=UpdateTagColumnsRequest(
columns=[
TagColumnUpdateItem(
column_name="order_id",
description="Unique identifier for each customer order",
),
TagColumnUpdateItem(
column_name="total_amount",
description="Total order value in USD, including tax",
),
]
),
)
for column in updated_columns:
print(f"{column.column_name}: {column.description}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const columns = await client.datasources.tables.updateColumnDescriptions(
"ds_abc123",
"customers",
{
columns: [
{
column_name: "customer_id",
description: "Unique identifier for the customer record",
},
{
column_name: "signup_date",
description: "Date the customer created their account",
},
],
}
);
console.log(`${columns[0].column_name}: ${columns[0].description}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
columns, err := client.Datasources.Tables.UpdateColumnDescriptions(
context.Background(),
"ds_9f8a7b6c5d4e",
"customer_orders",
v2.UpdateTagColumnsRequest{
Columns: []v2.TagColumnUpdateItem{
{
ColumnName: "order_id",
Description: "Unique identifier for each customer order",
},
{
ColumnName: "order_total",
Description: "Total order amount in USD, including tax and shipping",
},
},
},
)
if err != nil {
fmt.Println("error:", err)
return
}
for _, col := range columns {
fmt.Printf("%s (%s): %s\n", col.ColumnName, col.Type, col.Description)
}
}curl --request PUT \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"columns": [
{
"column_name": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({columns: [{column_name: '<string>', description: '<string>'}]})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'columns' => [
[
'column_name' => '<string>',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"column_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/tables/{table_name}/columns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": [\n {\n \"column_name\": \"<string>\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"column_name": "<string>",
"type": "<string>",
"description": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Bulk update of column descriptions on a single table.
One entry per column to update on the target table
Show child attributes
Show child attributes
Was this page helpful?
⌘I