Get Table
Retrieve detailed information about a specific table using the table ID or name. The Boltic Tables SDK provides multiple methods to get table details: findById(), findByName(), and findOne().
Method Signatures
// Get table by ID
client.tables.findById(id: string): Promise<ApiResponse<TableRecord>>
// Get table by name
client.tables.findByName(name: string): Promise<ApiResponse<TableRecord>>
// Get table with custom query
client.tables.findOne(options: TableQueryOptions): Promise<ApiResponse<TableRecord>>
Parameters
findById Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique table identifier |
findByName Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Table name |
findOne Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | TableQueryOptions | ✅ | Query options (must identify a single table) |
Return Value
All methods return the same TableRecord structure:
interface TableRecord {
id: string; // Unique table identifier
name: string; // Table name
account_id: string; // Account identifier
internal_db_name: string; // Database name
db_id?: string; // Database UUID
resource_id?: string; // Resource identifier
description?: string; // Table description
type?: string; // Table type
parent_table_id?: string; // Parent table reference
is_deleted: boolean; // Soft-delete status
is_public: boolean; // Public visibility
created_by: string; // Creator identifier
created_at: string; // Creation timestamp
updated_at: string; // Last update timestamp
updated_by: string; // Last updater identifier
source?: "boltic" | "copilot"; // Creation source
account_status?: "active" | "suspended" | "deleted"; // Account status
}
Examples
Get Table by ID
import { createClient } from "@boltic/sdk";
const client = createClient("your-api-key");
const { data: table, error } = await client.tables.findById("table_uuid");
if (error) {
console.error("Failed to get table:", error.message);
} else {
console.log("Table details:");
console.log(`- Name: ${table.name}`);
console.log(`- Description: ${table.description || "No description"}`);
console.log(`- Created: ${new Date(table.created_at).toLocaleDateString()}`);
console.log(`- Public: ${table.is_public ? "Yes" : "No"}`);
}