Access Control
Control table visibility and access permissions using the client.tables.setAccess() method. This operation allows you to make tables public or private, controlling who can access your data.
Method Signature
client.tables.setAccess(request: TableAccessRequest): Promise<ApiResponse<TableRecord>>
Parameters
TableAccessRequest
| Parameter | Type | Required | Description |
|---|---|---|---|
table_name | string | ✅ | Name of the table to modify |
is_shared | boolean | ✅ | Whether the table should be publicly accessible |
Return Value
Returns the updated TableRecord with the new access settings:
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; // Deletion 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
}
Access Levels
Public Tables (is_shared: true)
- Visibility: Accessible to anyone within account
- Read Access: Anyone can view table structure and data
- Write Access: Anyone can write data to the table
- Use Cases: Public datasets, shared catalogs, open data
Private Tables (is_shared: false)
- Visibility: Only accessible by table owner
- Read Access: Restricted to table owner
- Write Access: Restricted to table owner
- Use Cases: Internal data, sensitive information, private projects
Examples
Make Table Public
import { createClient } from "@boltic/sdk";
const client = createClient("your-api-key");
const { data: table, error } = await client.tables.setAccess({
table_name: "product_catalog",
is_shared: true,
});
if (error) {
console.error("Failed to make table public:", error.message);
} else {
console.log(`Table "${table.name}" is now public`);
console.log(`Public access: ${table.is_public ? "Yes" : "No"}`);
}