Skip to content

Implementation of ODBC's setup API #13

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

Merged
merged 9 commits into from
Aug 13, 2018
Merged

Implementation of ODBC's setup API #13

merged 9 commits into from
Aug 13, 2018

Conversation

bpintea
Copy link
Collaborator

@bpintea bpintea commented Aug 10, 2018

This PR implements the two required functions part of the setup API. This API is used for installation and configuration of the ODBC driver and can be implemented as stand-alone library or part of the ODBC driver itself.
For simplicity and inline with other implementations, the functions are implemented in the driver library, in setup.[ch] module.

One function, ConfigDriver() is called by the installer DLL (which is part of OS'es ODBC stack) to "configure" the driver -- have the driver populate the needed registry keys.
The other, ConfigDSN() is called by the administrator program to manage the configurations for the data sources available through the driver.

The GUI associated with the DSN management is left out for now and will be added at a later point (this work is ongoing in parallel).

bpintea added 9 commits July 29, 2018 17:27
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.
@bpintea bpintea mentioned this pull request Aug 10, 2018
Closed
@bpintea bpintea merged commit 14fb508 into elastic:master Aug 13, 2018
@bpintea bpintea deleted the feature/setup_api branch August 14, 2018 09:56
@bpintea
Copy link
Collaborator Author

bpintea commented Aug 14, 2018

PR merged part of #14.

@bpintea bpintea added >feature Applicable to PRs adding new functionality v6.5.0 labels May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature Applicable to PRs adding new functionality v6.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant