Skip to content

Commit

Permalink
docs: Update ODBC driver usage (#615)
Browse files Browse the repository at this point in the history
* docs: Various updates

* docs: Remove documentation for files restricted to CWD
  • Loading branch information
peasee authored Nov 5, 2024
1 parent ef5ffec commit 9828292
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
29 changes: 29 additions & 0 deletions spiceaidocs/docs/components/data-connectors/odbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@ For the best `JOIN` performance, ensure all ODBC datasets from the same database

:::

## ODBC Connection String

The ODBC connection string requires the use of an installed and registered driver based on your system type:

- Unix systems; ODBC driver installations can be managed using [unixODBC](https://www.unixodbc.org/), or directly edited through `/etc/odbc.ini` or `/etc/odbcinst.ini`. For example, in the [Databricks DSN Connection Setup Guide](https://docs.databricks.com/en/integrations/odbc/dsn.html#linux) for Linux.
- Windows systems; ODBC driver installations are managed using the [ODBC Data Source Administrator](https://support.microsoft.com/en-au/office/administer-odbc-data-sources-b19f856b-5b9b-48c9-8b93-07484bfab5a7).

For an example Unix system with an installed PostgreSQL driver where the contents of `/etc/odbcinst.ini` is:

```ini
[PostgreSQL Unicode]
Description=PostgreSQL ODBC driver (Unicode version)
Driver=psqlodbcw.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1
```

The Spice Runtime can use this driver installation where `Driver={PostgreSQL Unicode}` is used in the connection string, like:

```yaml
datasets:
- from: odbc:my_table
name: my_dataset
params:
odbc_connection_string: Driver={PostgreSQL Unicode};Server=localhost;Port=5432;Database=postgres;Uid=myuser;Pwd=mypass
```

## Configuration

In addition to the connection string, the following [arrow_odbc builder parameters](https://docs.rs/arrow-odbc/latest/arrow_odbc/struct.OdbcReaderBuilder.html) are exposed as params:
Expand Down
18 changes: 15 additions & 3 deletions spiceaidocs/docs/components/secret-stores/env/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,24 @@ MY_PG_PASSWORD=postgres

### Additional Parameters

To load environment variables from a specific `.env` file, use the `file_path` parameter. When using specific environment variable file using `file_path` environment variables from the default `.env` or `.env.local` files will not be loaded.
To load environment variables from a specific `.env` file, use the `file_path` parameter. When a `file_path` parameter is specified, environment variables from `.env` or `.env.local` will not be loaded.

```yaml
secrets:
- from: env
name: env
params:
file_path: /custom/path/to/.env
```
file_path: ./custom/path/to/.env
```

To continue loading `.env` or `.env.local`, specify them as additional secret stores:

```yaml
secrets:
- from: env
name: env
- from: env
name: env
params:
file_path: ./custom/path/to/.env
```
4 changes: 4 additions & 0 deletions spiceaidocs/docs/components/secret-stores/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The Secret Store type and name are specified using the `from` and `name` fields.
Additional parameters may be specified in the `params` field, which are typically specific to the secret store type.

Example:

```yaml
secrets:
- from: kubernetes:my_secret
Expand All @@ -43,6 +44,7 @@ secrets:
Secrets may be used by components with the syntax `${<secret_store_name>:<key_name>}`. For example, to reference a secret stored as an environment variable named `MY_SECRET` in the `env` secret store, use `${env:MY_SECRET}`.

Example:

```yaml
datasets:
- from: postgres:my_table
Expand All @@ -67,6 +69,7 @@ datasets:
The `<secret_store_name>` value in `${<secret_store_name>:<key_name>}` is the `name` value defined in the secret store configuration. This can be renamed to any value.

Example:

```yaml
secrets:
- from: env
Expand All @@ -91,6 +94,7 @@ Spice supports configuring multiple secret stores which are loaded in the order
To load a secret from any of the configured secret stores in precedence order, use the `${secrets:<key_name>}` syntax.

Example:

```yaml
secrets:
- from: env
Expand Down

0 comments on commit 9828292

Please sign in to comment.