ODBC
On Linux, libkova.so is a unixODBC driver. It sends SQL to a Kova server and returns the rows.
The install puts the driver at ~/.local/lib/libkova.so, next to the directory that holds kova. It speaks unixODBC. A client loads that library, connects, and runs SQL. The server runs the same { sql } command a shell would send.
The driver is Linux. A client maps libkova.so for the life of its process, so a rebuilt library loads after that process quits and opens again.
Register the driver
Install unixODBC (unixodbc on Debian and Ubuntu). Point the driver manager at the library. In ~/.odbcinst.ini:
[Kova] Driver=/home/you/.local/lib/libkova.so
The installer writes that section for you, with your home directory in the path. In ~/.odbc.ini, a data source names the host, the port, and the database:
[Kova] Driver=Kova SERVER=127.0.0.1 PORT=27018 DATABASE=db
The connection string is the same keys in one line:
DRIVER=Kova;SERVER=127.0.0.1;PORT=27018;DATABASE=db
| Key | Meaning |
|---|---|
SERVER | Host of the Kova listener. A machine on the network is fine. |
PORT | Defaults to 27018. |
DATABASE | The $db of every SQL command on this connection. |
UID and PWD | Sent together as authenticate before any SQL. Leave both empty while security is off. Set both when it is on. One of the two is refused. A wrong password is refused with the server's authentication error. |
What a client can list
A client asks the driver for tables and columns. Tables are the collections and views of DATABASE. The type column is TABLE or VIEW. Columns come from admin.fields. A collection the catalog has not typed yet is sampled from its documents. COLUMN_NAME is the fourth column of that result and DATA_TYPE is the fifth, which is the order ODBC clients read.
Quoted identifiers are case-sensitive. emp and EMP are different names, matching the server.
Parameter markers (?) are not bound. Write the values into the SQL text. Primary-key and statistics calls wait until a client error names them. Until then, list tables, list columns, and run the statement.
Run a statement
With the server up and the sample loaded, a client connected to DSN Kova can run:
SELECT ename, job, sal FROM emp WHERE sal > 2000 SELECT ename, job, sal FROM emp_search WHERE TEXT 'clerk'
The rows match db.runCommand({ sql }) on database db.