-
Notifications
You must be signed in to change notification settings - Fork 30
SQLGetData API call #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The setup API is meant to assist with installation of the driver.
stderr redirect will always work
- prompt_user_config() will pop up a dialog-box for connection config; - prompt_user_overwrite() will confirm with the user that a config is to be overwritten.
builds/.gitignore can get cleaned away, move its content into top .gitignore
- add a DSN to start from; - remove small code duplication in SQLDriverConnect; - change config priorities in ConfigDSN(), as follows (most relevant first): . 00-list received as parameter; . registry values; . defaults.
The values from the registry are read into a static buffer, indexed for each entry into the esodbc_dsn_attrs_st structure. Make sure that the indexing is done only for those values in the Registry that have a correspondence in the structure. Also, use SQLWCHAR explicitely instead of the TCHAR (should be same values for Unicode compilation, but might generate issues later.)
Moved from all-static/all-dynamic to all-static, to simplify code management.
- add a few more attributes to SQLGetInfo, some describing SQLGetData extentions - WIP on SQLGetData: set-up the temporary binding-unbinding on the requested column. Since SQLGetData requires no state maintenance except position in the source data, the binding is done with a static ARD; if the column index is lower-or-equal to a constant (128), the ARD will also use a static array of records; otherwise a new array is allocated-freed.
Also: - replace boolean conversion function, delegate that to the long long conversion function; - unify functions transfering SQLWCHAR and SQLCHAR strings to application to minimize code duplication; - build.bat : stop on error and propagate it to script exit; - CMakeLists.txt: add flag for parallel building.
move around the 0-terminator accounting, for better code clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I just saw a couple of nits you might want to revisit.
build.bat
Outdated
:END | ||
echo %ERRORLEVEL% | ||
exit /b 0 | ||
exit /b %ERRORLEVEL% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like only one of these exit
s should be here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks, fixed.
.gitignore
Outdated
@@ -1,3 +1,5 @@ | |||
*.swp | |||
driver/*.swp | |||
builds/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the canonical way to ignore a whole directory is just to list the directory name with a slash (no star). I.e. builds/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
This PR adds the implementation for SQLGetData(). This function is an alternative to column binding: while SQLBindColumn() binds multiple subsequently have have all the bound buffers have data copied into with one SQLFetch() call, SQLGetData() will fetch one single column at a time. This functionality is used for "long data": in case the data source has a large amount of data in one (or multiple columns), it might not be feasible for the application to bind large enough buffers and have all the data in one go.
Theoretically the driver could access the cell data synchronously (or quasi~) with each SQLGetData call. In case of Elasticsearch/SQL however, this is not needed/possible, since each REST call will return an entire row.