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

# connect_with_options

> connect_with_options — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[sqlx\_support](https://docs.kinetica.com/content/api/rust/sqlx_support/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sqlx_support.rs#L590-L598)&#x20;

<pre>`pub async fn connect_with_options(    options: PgConnectOptions,    max_connections: u32,) -> Result<KineticaPool, Error>`</pre>

Connect to Kinetica using `PgConnectOptions`.This gives you full control over connection options.

## Example

```rust theme={null}
use gpudb_api::sqlx_support::connect_with_options;
use sqlx::postgres::PgConnectOptions;

let options = PgConnectOptions::new()
    .host("localhost")
    .port(5432)
    .username("admin")
    .password("password")
    .database("postgres");

let pool = connect_with_options(options, 10).await?;
```


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