> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# lock_table

### lock\_table

<ul>
  <li>
    lock\_table(\
    &#x20;table\_name: string,\
    &#x20;lock\_type?: string,\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md),\
    ): Promise\<[LockTableResponse](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableResponse.md)>

    Manages global access to a table's data. By default a table has a `lock_type` of read\_write, indicating all operations are permitted. A user may request a read\_only or a write\_only lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When `lock_type` is no\_access then no operations are permitted on the table. The lock status can be queried by setting `lock_type` to status.

    #### Parameters

    <ul>
      <li>
        table\_name: string

        Name of the table to be locked, in \[schema\_name.]table\_name format, using standard name resolution rules. It must be a currently existing table or view.
      </li>

      <li>
        `Optional`lock\_type: string

        The type of lock being applied to the table. Setting it to status will return the current lock status of the table without changing it.
      </li>

      <li>
        `Optional`options: Record\<string, string>

        Optional parameters.
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[LockTableResponse](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableResponse.md)>

    Promise\<Types.LockTableResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:12166](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L12166)</li>
    </ul>
  </li>
</ul>

### lock\_table\_request

<ul>
  <li>
    lock\_table\_request(\
    &#x20;request: [LockTableRequest](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md),\
    ): Promise\<[LockTableResponse](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableResponse.md)>

    Manages global access to a table's data. By default a table has a `lock_type` of read\_write, indicating all operations are permitted. A user may request a read\_only or a write\_only lock, after which only read or write operations, respectively, are permitted on the table until the lock is removed. When `lock_type` is no\_access then no operations are permitted on the table. The lock status can be queried by setting `lock_type` to status.

    #### Parameters

    <ul>
      <li>
        request: [LockTableRequest](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableRequest.md)

        Request object containing the parameters for the operation
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[LockTableResponse](https://docs.kinetica.com/content/api/typescript/interfaces/LockTableResponse.md)>

    Promise\<Types.LockTableResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:12135](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L12135)</li>
    </ul>
  </li>
</ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.