Where the operating system stores ODBC data source names so the Delta Forge driver can find them.
~/.odbc.ini | /etc/odbc.ini | ~/Library/ODBC/odbc.ini | HKCU\Software\ODBC\ODBC.INI\<DSN>
## Per-platform table | Platform | User DSN | System DSN | |---|---|---| | Linux (unixODBC) | `~/.odbc.ini` | `/etc/odbc.ini` | | macOS (iODBC) | `~/Library/ODBC/odbc.ini` | `/Library/ODBC/odbc.ini` | | Windows | `HKCU\Software\ODBC\ODBC.INI\<DSN>` | `HKLM\Software\ODBC\ODBC.INI\<DSN>` | The driver itself is registered separately so the OS can resolve a `Driver=...` clause to a shared object: | Platform | Driver registration | |---|---| | Linux (unixODBC) | `~/.odbcinst.ini` (user) or `/etc/odbcinst.ini` (system) | | macOS (iODBC) | `~/Library/ODBC/odbcinst.ini` (user) or `/Library/ODBC/odbcinst.ini` (system) | | Windows | `HKLM\Software\ODBC\ODBCINST.INI\DeltaForge ODBC Driver` | ## DSN vs. driver string There are two shapes a connection string can take: ``` # DSN-based (DSN exists in odbc.ini / registry; driver is resolved through it) DSN=DeltaForge;Uid=alice@example.com;Pwd=hunter2 # Driver-based (no DSN, driver looked up by name in odbcinst.ini / registry) Driver={DeltaForge ODBC Driver};Server=https://df.example.com;Uid=alice@example.com;Pwd=hunter2 ``` Driver-based strings are convenient for code that ships across machines without depending on a system-managed DSN. DSN-based strings are convenient for hiding URLs and TLS posture from end users (the BI analyst sees just `DSN=DeltaForge`). ## Editing user DSNs by hand Linux and macOS use a plain INI format. Each DSN is a `[Section]`, the keys inside are the connection-string keys minus the `Driver=` clause (which lives in odbcinst.ini). Adding a key under the section is equivalent to passing it on every connect. Windows users should prefer the **ODBC Data Source Administrator** (`odbcad32.exe`) over hand-editing the registry. The `Get-OdbcDsn` / `Add-OdbcDsn` PowerShell cmdlets work too and are scriptable. ## Discovering DSNs programmatically ```bash # Linux / macOS odbcinst -q -s # list all DSNs odbcinst -q -s -n DeltaForge # dump one DSN ``` ```powershell # Windows Get-OdbcDsn -Platform 64-bit ``` ```python # Cross-platform (any pyodbc install) import pyodbc for dsn in pyodbc.dataSources(): print(dsn) ```
# Linux user DSN (~/.odbc.ini)
[DeltaForge]
Driver=DeltaForge ODBC Driver
Server=https://df.example.com
Uid=alice@example.com
# macOS user DSN (~/Library/ODBC/odbc.ini)
[ODBC Data Sources]
DeltaForge = DeltaForge ODBC Driver
[DeltaForge]
Driver = /usr/local/lib/libdeltaforgeodbc.dylib
Server = https://df.example.com
Uid = alice@example.com
# Windows: enumerate via PowerShell
Get-OdbcDsn -Name DeltaForge -Platform 64-bit