Description
Some of the 2.x applications - or even 3.x ones, updated from a 2.x base - make use of the ODBC API in a way that is currently difficult to support with ES/SQL API:
-
They prepare a statement with
SQLPrepare
, then require attributes of the columns that would be later fetched (bySQLExecute
), withSQLNumResultCols
andSQLColAttribute
.
This is difficult to support since there's no concept of statement preparation in ES/SQL. However, the driver could detect the pattern and issue something likeSELECT * FROM (<original statement>) WHERE false
. :: Add an early execution mode for prepared statements #227 -
They require the available rows after executing a statement, with
SQLRowCount
. The count is not currently available in ES/SQL API, which would need to be expanded, or, alternatively, the driver could issue something likeSELECT COUNT(*) FROM (<original staement>)
. -
Another case is the way tables are reported (
TABLE
vsBASE TABLE
). The current server-side heuristic doesn't cover all clients expecting one format or the other and having a driver-side switch (=config option) both simplifies the server-code and makes the driver more useful with these apps. :: SQL: drop BASE TABLE type in favour for just TABLE elasticsearch#54836
This usage patterns are now discouraged or warned against by the current ODBC documentation, but not disallowed.