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

# connection_url_from_env

> connection_url_from_env — 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#L1427-L1444)&#x20;

<pre>`pub fn connection_url_from_env() -> Option<String>`</pre>

Parse a Kinetica connection URL from environment variables.Looks for:

<ul>
  <li>`KINETICA_SQLX_URL` - Full connection URL</li>
  <li>Or individual: `KINETICA_HOST`, `KINETICA_PORT`, `KINETICA_USER`, `KINETICA_PASSWORD`</li>
</ul>

## Example

```rust theme={null}
use gpudb_api::sqlx_support::connection_url_from_env;

// Set KINETICA_SQLX_URL=postgres://admin:password@localhost:5432/postgres
// Or set KINETICA_HOST, KINETICA_USER, KINETICA_PASSWORD

let url = connection_url_from_env();
```


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