List Columns
Retrieve all columns in a table with powerful filtering, sorting, and pagination capabilities.
findAll()
Retrieve columns with optional query parameters for filtering, sorting, and pagination.
client.columns.findAll(tableName: string, options?: ColumnQueryOptions): Promise<BolticListResponse<ColumnDetails> | BolticErrorResponse>
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tableName | string | ✅ | Name of the target table |
options | ColumnQueryOptions | ❌ | Query options for filtering, sorting, pagination |
ColumnQueryOptions
| Property | Type | Description |
|---|---|---|
where | Record<string, any> | Filter conditions using operators |
fields | string[] | Specific fields to include in response |
sort | SortOption[] | Sort criteria with field and direction |
limit | number | Maximum number of results to return |
offset | number | Number of results to skip |
page | { page_no: number, page_size: number } | Page-based pagination |
Basic Usage
Get All Columns
const { data: columns, error } = await client.columns.findAll("products");
if (!error) {
console.log(`Found ${columns.length} columns:`);
columns.forEach((column) => {
console.log(`- ${column.name} (${column.type})`);
});
}
Response Format
{
data: [
{
id: "col_123456",
name: "title",
type: "text",
description: "Product title",
is_nullable: false,
is_indexed: true,
is_unique: false,
is_visible: true,
default_value: null,
created_at: "2024-01-01T00:00:00Z",
updated_at: "2024-01-01T00:00:00Z"
},
{
id: "col_789012",
name: "price",
type: "currency",
currency_format: "USD",
decimals: "0.00",
description: "Product price",
is_nullable: false,
is_indexed: true,
// ... more properties
}
// ... more columns
],
pagination: {
current_page: 1,
total_pages: 2,
total_count: 15,
page_size: 10
}
}
Filtering
Use the where parameter with filter operators to find specific columns.
Basic Filtering
// Get all text columns
const { data: textColumns } = await client.columns.findAll("products", {
where: { type: "text" },
});
// Get nullable columns
const { data: nullableColumns } = await client.columns.findAll("products", {
where: { is_nullable: true },
});
// Get indexed columns
const { data: indexedColumns } = await client.columns.findAll("products", {
where: { is_indexed: true },
});