Tables
(search.tables)
Overview
Available Operations
- createTable - Create Table
- getTableSchema - Get Table Schema
- deleteTable - Delete Table
- insertData - Insert Data
- deleteData - Delete Data
- searchData - Search
- createIndices - Create Indices
- listIndices - List Indices
- dropIndex - Drop Index
createTable
Create a new table with the specified schema.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.createTable({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
name: "<value>",
schema: {
fields: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesCreateTable } from "@meetkai/mka1/funcs/searchTablesCreateTable.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesCreateTable(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
name: "<value>",
schema: {
fields: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesCreateTable failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesCreateTableMutation
} from "@meetkai/mka1/react-query/searchTablesCreateTable.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | components.CreateTableRequest | ✔️ | The request object to use for the request. |
security | operations.CreateTableSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.CreateTableResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ValidationErrorResponse | 400 | application/json |
| errors.TableErrorResponse | 409 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
getTableSchema
Get table schema and metadata.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.getTableSchema({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesGetTableSchema } from "@meetkai/mka1/funcs/searchTablesGetTableSchema.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesGetTableSchema(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesGetTableSchema failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useSearchTablesGetTableSchema,
useSearchTablesGetTableSchemaSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchSearchTablesGetTableSchema,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateSearchTablesGetTableSchema,
invalidateAllSearchTablesGetTableSchema,
} from "@meetkai/mka1/react-query/searchTablesGetTableSchema.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetTableSchemaRequest | ✔️ | The request object to use for the request. |
security | operations.GetTableSchemaSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.GetTableResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteTable
Delete a table.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.deleteTable({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesDeleteTable } from "@meetkai/mka1/funcs/searchTablesDeleteTable.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesDeleteTable(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesDeleteTable failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesDeleteTableMutation
} from "@meetkai/mka1/react-query/searchTablesDeleteTable.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteTableRequest | ✔️ | The request object to use for the request. |
security | operations.DeleteTableSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.DeleteTableResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
insertData
Insert data into the specified table.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.insertData({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
insertDataRequest: {
data: [
{
"key": "<value>",
"key1": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
{
},
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesInsertData } from "@meetkai/mka1/funcs/searchTablesInsertData.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesInsertData(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
insertDataRequest: {
data: [
{
"key": "<value>",
"key1": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
{
},
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesInsertData failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesInsertDataMutation
} from "@meetkai/mka1/react-query/searchTablesInsertData.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.InsertDataRequest | ✔️ | The request object to use for the request. |
security | operations.InsertDataSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.InsertDataResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ValidationErrorResponse | 400 | application/json |
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteData
Delete data from a table using a filter expression. https://lancedb.github.io/lancedb/guides/tables/#deleting-from-a-table
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.deleteData({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
deleteDataRequest: {
filter: "<value>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesDeleteData } from "@meetkai/mka1/funcs/searchTablesDeleteData.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesDeleteData(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
deleteDataRequest: {
filter: "<value>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesDeleteData failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesDeleteDataMutation
} from "@meetkai/mka1/react-query/searchTablesDeleteData.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteDataRequest | ✔️ | The request object to use for the request. |
security | operations.DeleteDataSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.DeleteDataResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
searchData
Perform search operations on a table.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.searchData({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
searchRequest: {},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesSearchData } from "@meetkai/mka1/funcs/searchTablesSearchData.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesSearchData(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
searchRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesSearchData failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesSearchDataMutation
} from "@meetkai/mka1/react-query/searchTablesSearchData.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SearchDataRequest | ✔️ | The request object to use for the request. |
security | operations.SearchDataSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.SearchResult>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
createIndices
Create indices on the specified table.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.createIndices({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
createIndicesRequest: {
indices: [
{
field: "<value>",
config: {
type: "IVF_HNSW_PQ",
distanceType: "l2",
numBits: 8,
maxIterations: 50,
sampleRate: 256,
m: 16,
efConstruction: 200,
},
},
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesCreateIndices } from "@meetkai/mka1/funcs/searchTablesCreateIndices.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesCreateIndices(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
createIndicesRequest: {
indices: [
{
field: "<value>",
config: {
type: "IVF_HNSW_PQ",
distanceType: "l2",
numBits: 8,
maxIterations: 50,
sampleRate: 256,
m: 16,
efConstruction: 200,
},
},
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesCreateIndices failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesCreateIndicesMutation
} from "@meetkai/mka1/react-query/searchTablesCreateIndices.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateIndicesRequest | ✔️ | The request object to use for the request. |
security | operations.CreateIndicesSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.CreateIndicesResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ValidationErrorResponse | 400 | application/json |
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
listIndices
List all indices on the specified table.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.listIndices({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesListIndices } from "@meetkai/mka1/funcs/searchTablesListIndices.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesListIndices(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesListIndices failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useSearchTablesListIndices,
useSearchTablesListIndicesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchSearchTablesListIndices,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateSearchTablesListIndices,
invalidateAllSearchTablesListIndices,
} from "@meetkai/mka1/react-query/searchTablesListIndices.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListIndicesRequest | ✔️ | The request object to use for the request. |
security | operations.ListIndicesSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.ListIndicesResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
dropIndex
Drop an index on the specified field.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.search.tables.dropIndex({
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
fieldName: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTablesDropIndex } from "@meetkai/mka1/funcs/searchTablesDropIndex.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await searchTablesDropIndex(sdk, {
httpBearer: "<YOUR_API_KEY_HERE>",
}, {
tableName: "<value>",
fieldName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTablesDropIndex failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useSearchTablesDropIndexMutation
} from "@meetkai/mka1/react-query/searchTablesDropIndex.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DropIndexRequest | ✔️ | The request object to use for the request. |
security | operations.DropIndexSecurity | ✔️ | The security requirements to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.DropIndexResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TableErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |