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

# create_datasink

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasink.rs#L25-L32)
pub async fn [create\_datasink](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasink.md#method.create_datasink)( \&self, name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), destination: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasinkResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a data sinkCreates a data sink, which contains the destination information for a data sink that is external to the database.

##### Arguments

<ul>
  <li>
    `name` - Name of the data sink to be created.
  </li>

  <li>
    `destination` - Destination for the output data in format ‘storage\_provider\_type://path\[:port]’.Supported storage provider types are ‘azure’, ‘gcs’, ‘hdfs’, ‘http’, ‘https’, ‘jdbc’, ‘kafka’, and ‘s3’.
  </li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasink.rs#L49-L67)
pub async fn [create\_datasink\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasink.md#method.create_datasink_with_opts)( \&self, name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), destination: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateDatasinkRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasinkResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a data sinkCreates a data sink, which contains the destination information for a data sink that is external to the database.

##### Arguments

<ul>
  <li>
    `name` - Name of the data sink to be created.
  </li>

  <li>
    `destination` - Destination for the output data in format ‘storage\_provider\_type://path\[:port]’.Supported storage provider types are ‘azure’, ‘gcs’, ‘hdfs’, ‘http’, ‘https’, ‘jdbc’, ‘kafka’, and ‘s3’.
  </li>

  <li>
    `options` - The optional parameters; any left unset take the server’s defaults.
  </li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasink.rs#L70-L81)
pub async fn [create\_datasink\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasink.md#method.create_datasink_raw)( \&self, request: &[CreateDatasinkRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasinkResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateDatasinkRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkRequest) to the `/create/datasink` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_datasink.rs#L85-L97)
pub async fn [create\_datasink\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-datasink.md#method.create_datasink_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateDatasinkRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateDatasinkResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateDatasinkRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateDatasinkRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


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