Skip to main content

Get Column

Retrieve detailed information about specific columns in your tables using either column name or ID.

findOne()

Get a specific column by its name.

client.columns.findOne(tableName: string, columnName: string): Promise<BolticSuccessResponse<ColumnDetails> | BolticErrorResponse>

Parameters

ParameterTypeRequiredDescription
tableNamestringName of the target table
columnNamestringName of the column to retrieve

Examples

const { data: column, error } = await client.columns.findOne("products", "price");

if (error) {
console.error("Column not found:", error.message);
} else {
console.log("Column details:", column);
console.log("Type:", column.type);
console.log("Nullable:", column.is_nullable);
console.log("Indexed:", column.is_indexed);
}

Response Format

{
data: {
id: "26b364ef-0401-49b2-aae3-ebe43ae14eca",
table_id: "83c6b498-9157-483c-b872-662298ec2c38",
name: "title",
field_order: 1,
type: "text",
alignment: "left",
description: "Product title",
default_value: null,
is_primary_key: false,
is_unique: true,
is_nullable: false,
is_indexed: true,
is_visible: true,
is_readonly: false,
decimals: null,
timezone: null,
selection_source: null,
selectable_items: [],
multiple_selections: false,
phone_format: null,
date_format: null,
time_format: null,
currency_format: null,
vector_dimension: null,
created_at: '2025-08-19T09:51:12.568Z',
updated_at: '2025-08-19T09:51:18.026Z',
created_by: '[email protected]',
updated_by: '[email protected]',

}
}

findById()

Get a specific column by its unique ID.

client.columns.findById(tableName: string, columnId: string): Promise<BolticSuccessResponse<ColumnDetails> | BolticErrorResponse>

Parameters

ParameterTypeRequiredDescription
tableNamestringName of the target table
columnIdstringUnique ID of the column to retrieve

Example

const { data: column, error } = await client.columns.findById("products", "column_uuid");

if (!error) {
console.log("Found column:", column.name);
console.log("Type:", column.type);
console.log("Created:", column.created_at);
}

Type-Specific Details

Different column types return specific properties in their responses.

Text Fields

const { data: textColumn } = await client.columns.findOne("users", "first_name");

// Available for all text types
console.log("Type:", textColumn.type); // 'text', 'long-text', 'email', 'link'

Phone Number Fields

const { data: phoneColumn } = await client.columns.findOne("users", "phone");

console.log("Phone format:", phoneColumn.phone_format); // Example: '+1 (123) 456-7890'

Currency Fields

const { data: priceColumn } = await client.columns.findOne("products", "price");

console.log("Currency:", priceColumn.currency_format); // 'USD', 'EUR', etc.
console.log("Decimals:", priceColumn.decimals); // '0.00'
const { data: categoryColumn } = await client.columns.findOne("products", "category");

console.log("Available options:", categoryColumn.selectable_items);
console.log("Multiple selections:", categoryColumn.multiple_selections);
console.log("Default option:", categoryColumn.default_value);

Date-Time Fields

const { data: dateColumn } = await client.columns.findOne("events", "event_date");

console.log("Date format:", dateColumn.date_format); // 'MM/DD/YYYY'
console.log("Time format:", dateColumn.time_format); // 'HH:mm:ss'

Vector Fields

const { data: vectorColumn } = await client.columns.findOne("documents", "embeddings");

console.log("Dimensions:", vectorColumn.vector_dimension); // 1536, 512, etc.
console.log("Is indexed:", vectorColumn.is_indexed); // For similarity search

Number Fields

const { data: quantityColumn } = await client.columns.findOne("products", "quantity");

console.log("Decimal format:", quantityColumn.decimals); // '0', '0.00', '0.000'

Comparison: findOne() vs findById()

AspectfindOne()findById()
Lookup MethodBy column nameBy column ID
Human Readable✅ Yes❌ No
Stable Reference❌ Names can change✅ IDs are permanent
PerformanceFast (indexed)Very fast (primary key)
Use CaseSchema managementSystem references

When to Use Each

Use findOne() when:

  • Working with known column names
  • Building user interfaces
  • Schema validation and management
  • General application development

Use findById() when:

  • Working with stored column references
  • System integrations
  • When you have the ID from previous operations
  • Building column relationship mappings