From Exponential 6.0.15 the kernel has a generic ODBC driver: one driver for every database that has an ODBC driver, with the SQL it writes chosen by a dialect in the settings.
What it is for
Named connections of the data table layer to databases the installation has no native driver for, or that a host only offers through ODBC, and the import of Microsoft Access files. A site itself runs on its native driver; the installers do not offer ODBC for a site's own database.
Dialects
sqlserver, postgresql, mysql (MySQL and MariaDB), sqlite, oracle, msaccess or generic. The dialect decides paging, the new id after an insert, escaping and the session setup, so the connection behaves like that engine.
A data table connection
[Connection_crm] Engine=odbc Server=db.example.com Port=5432 Database=crm User=crm Secret=env:CRM_DB_PASSWORD Dialect=postgresql ODBCDriver=PostgreSQL Unicode ConnectionString=SSLmode=require
The password comes from the environment (Secret=env:...), never from the file. User and password go to the connect call, never into the connection string, and a failed connection's message has the password masked.
PHP layers
- pdo_odbc: PHP's PDO_ODBC, the default.
- odbc: PHP's odbc extension, the only layer with the catalog calls; chosen first for Access files.
Usual driver names
ODBC Driver 18 for SQL Server; PostgreSQL Unicode (odbc-postgresql on Debian and Ubuntu); MariaDB Unicode (odbc-mariadb); SQLite3 (libsqliteodbc); Microsoft Access Driver (*.mdb, *.accdb) on Windows. Name another with ODBCDriver, or use a DSN of odbc.ini instead.