Skip to content

Tables

(search.tables)

Overview

Available Operations

createTable

Create a new table with the specified schema.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesCreateTableMutation
} from "@meetkai/mka1/react-query/searchTablesCreateTable.js";

Parameters

ParameterTypeRequiredDescription
requestcomponents.CreateTableRequest✔️The request object to use for the request.
securityoperations.CreateTableSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.CreateTableResponse>

Errors

Error TypeStatus CodeContent Type
errors.ValidationErrorResponse400application/json
errors.TableErrorResponse409application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

getTableSchema

Get table schema and metadata.

Example Usage

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.GetTableSchemaRequest✔️The request object to use for the request.
securityoperations.GetTableSchemaSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.GetTableResponse>

Errors

Error TypeStatus CodeContent Type
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

deleteTable

Delete a table.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesDeleteTableMutation
} from "@meetkai/mka1/react-query/searchTablesDeleteTable.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteTableRequest✔️The request object to use for the request.
securityoperations.DeleteTableSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DeleteTableResponse>

Errors

Error TypeStatus CodeContent Type
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

insertData

Insert data into the specified table.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesInsertDataMutation
} from "@meetkai/mka1/react-query/searchTablesInsertData.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.InsertDataRequest✔️The request object to use for the request.
securityoperations.InsertDataSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.InsertDataResponse>

Errors

Error TypeStatus CodeContent Type
errors.ValidationErrorResponse400application/json
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

deleteData

Delete data from a table using a filter expression. https://lancedb.github.io/lancedb/guides/tables/#deleting-from-a-table

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesDeleteDataMutation
} from "@meetkai/mka1/react-query/searchTablesDeleteData.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteDataRequest✔️The request object to use for the request.
securityoperations.DeleteDataSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DeleteDataResponse>

Errors

Error TypeStatus CodeContent Type
errors.ErrorResponse400application/json
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

searchData

Perform search operations on a table.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesSearchDataMutation
} from "@meetkai/mka1/react-query/searchTablesSearchData.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.SearchDataRequest✔️The request object to use for the request.
securityoperations.SearchDataSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.SearchResult>

Errors

Error TypeStatus CodeContent Type
errors.ErrorResponse400application/json
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

createIndices

Create indices on the specified table.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesCreateIndicesMutation
} from "@meetkai/mka1/react-query/searchTablesCreateIndices.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateIndicesRequest✔️The request object to use for the request.
securityoperations.CreateIndicesSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.CreateIndicesResponse>

Errors

Error TypeStatus CodeContent Type
errors.ValidationErrorResponse400application/json
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

listIndices

List all indices on the specified table.

Example Usage

typescript
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:

typescript
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.

tsx
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

ParameterTypeRequiredDescription
requestoperations.ListIndicesRequest✔️The request object to use for the request.
securityoperations.ListIndicesSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListIndicesResponse>

Errors

Error TypeStatus CodeContent Type
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

dropIndex

Drop an index on the specified field.

Example Usage

typescript
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:

typescript
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.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchTablesDropIndexMutation
} from "@meetkai/mka1/react-query/searchTablesDropIndex.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DropIndexRequest✔️The request object to use for the request.
securityoperations.DropIndexSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DropIndexResponse>

Errors

Error TypeStatus CodeContent Type
errors.TableErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*