Skip to main content

Get Record

Retrieve individual records from your Boltic Tables by their unique identifier. The SDK provides simple methods for fetching single records with full type safety.

Get Record Operations

The SDK provides two approaches for retrieving individual records:

findOne() - Get Single Record by ID

Retrieve a specific record by its ID.

client.records.findOne(tableName: string, recordId: string): Promise<ApiResponse<RecordWithId>>

Examples

Direct Approach

import { createClient } from "@boltic/sdk";

const client = createClient("your-api-key");

const recordId = "rec_123456789";

const { data: record, error } = await client.records.findOne("users", recordId);

if (error) {
console.error("Record not found:", error.message);
} else {
console.log("Record details:", {
id: record.id,
name: record.name,
email: record.email,
created_at: record.created_at,
});
}

Response Format

Successful Response

interface GetRecordResponse {
data: {
id: string;
created_at: string;
updated_at: string;
[fieldName: string]: unknown;
};
error: null;
}

Error Response

interface GetRecordErrorResponse {
data: null;
error: {
message: string;
meta?: string[];
};
}