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

# export_records_to_files

### export\_records\_to\_files

<ul>
  <li>
    export\_records\_to\_files(\
    &#x20;table\_name: string,\
    &#x20;filepath: string,\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/nodejs/types/GPUdbCallback.md),\
    ): Promise\<[ExportRecordsToFilesResponse](https://docs.kinetica.com/content/api/nodejs/interfaces/ExportRecordsToFilesResponse.md)>

    Export records from a table to files. All tables can be exported, in full or partial (see columns\_to\_export and columns\_to\_skip). Additional filtering can be applied when using export table with expression through SQL. Default destination is KIFS, though other storage types (Azure, S3, GCS, and HDFS) are supported through datasink\_name; see `create_datasink`.Server's local file system is not supported. Default file format is delimited text. See options for different file types and different options for each file type. Table is saved to a single file if within max file size limits (may vary depending on datasink type). If not, then table is split into multiple files; these may be smaller than the max size limit.All filenames created are returned in the response.

    #### Parameters

    <ul>
      <li>
        table\_name: string

        The name of the table whose records are to be exported.
      </li>

      <li>
        filepath: string

        Path to data export target. If `filepath` has a file extension, it is read as the name of a file. If `filepath` is a directory, then the source table name with a random UUID appended will be used as the name of each exported file, all written to that directory. If filepath is a filename, then all exported files will have a random UUID appended to the given name. In either case, the target directory specified or implied must exist. The names of all exported files are returned in the response.
      </li>

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

        Optional parameters.
      </li>

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

        Optional callback function
      </li>
    </ul>

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

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

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

### export\_records\_to\_files\_request

<ul>
  <li>
    export\_records\_to\_files\_request(\
    &#x20;request: [ExportRecordsToFilesRequest](https://docs.kinetica.com/content/api/nodejs/interfaces/ExportRecordsToFilesRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/nodejs/types/GPUdbCallback.md),\
    ): Promise\<[ExportRecordsToFilesResponse](https://docs.kinetica.com/content/api/nodejs/interfaces/ExportRecordsToFilesResponse.md)>

    Export records from a table to files. All tables can be exported, in full or partial (see columns\_to\_export and columns\_to\_skip). Additional filtering can be applied when using export table with expression through SQL. Default destination is KIFS, though other storage types (Azure, S3, GCS, and HDFS) are supported through datasink\_name; see `create_datasink`.Server's local file system is not supported. Default file format is delimited text. See options for different file types and different options for each file type. Table is saved to a single file if within max file size limits (may vary depending on datasink type). If not, then table is split into multiple files; these may be smaller than the max size limit.All filenames created are returned in the response.

    #### Parameters

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

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

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

        Optional callback function
      </li>
    </ul>

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

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

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


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