12 |
13 | * Steps 3 & 4 will repeatedly get datarows until entire result is retrieved.
14 | * Step 5 will send a request to close cursor whenever the connection is closed.
15 | * ODBC Driver will provide an option to define fetch size as a connection parameter.
16 | * If fetch size is zero, query will fallback to non-cursor behavior.
17 | * If fetch size is not given then the number of rows per request will be as per server-defined [default fetch size](https://github.com/opendistro-for-elasticsearch/sql/blob/master/docs/dev/Pagination.md#42-salient-points).
18 | * ODBC Driver will send the request to close cursor whenever the connection is closed.
19 |
20 | ## Detailed Design
21 |
22 | The ODBC Driver will use std::promise and std::future to retrieve the result asynchronusly.
23 |
24 | * Thread to send queries is designed to get the next set of results.
25 | * Thread to process data is designed to parse the datarows and add the results in the resultset.
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/dev/example_config_files/elasticsearch.yml:
--------------------------------------------------------------------------------
1 | xpack.security.http.ssl.enabled: true
2 | xpack.security.http.ssl.client_authentication: none
3 | xpack.security.http.ssl.key_passphrase: password_if_applicable
4 | xpack.security.http.ssl.certificate: certificate.pem
5 | xpack.security.http.ssl.key: key.pem
--------------------------------------------------------------------------------
/docs/dev/example_config_files/example_tdc_file.tdc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/dev/example_config_files/kibana.yml:
--------------------------------------------------------------------------------
1 | # The URLs of the Elasticsearch instances to use for all your queries.
2 | elasticsearch.hosts: ["https://localhost:9200"]
3 |
4 | elasticsearch.ssl.verificationMode: none
5 |
6 | server.ssl.enabled: true
7 | server.ssl.certificate: /certificate.pem
8 | server.ssl.key: /key.pem
9 | server.ssl.clientAuthentication: none
10 |
--------------------------------------------------------------------------------
/docs/dev/img/async_result_retrieval.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/dev/img/async_result_retrieval.png
--------------------------------------------------------------------------------
/docs/dev/img/data_flow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/dev/img/data_flow.png
--------------------------------------------------------------------------------
/docs/dev/sequence_diagrams/SQLDriverConnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/dev/sequence_diagrams/SQLDriverConnect.png
--------------------------------------------------------------------------------
/docs/dev/sequence_diagrams/SQLDriverConnect.txt:
--------------------------------------------------------------------------------
1 | ODBCTest->psqlodbc Driver:SQLDriverConnect or SQLConnect
2 | psqlodbc Driver->libes (C interface):DB Parameters
3 | libes (C interface)->Connection Factory:ESConn
4 | Connection Factory->ESConn:Initialize ESConn
5 | ESConn->libes (C interface):ESConn object
6 | libes (C interface)->ESConn:DB Parameters
7 | ESConn->libes (C interface):DB Parameters Validation Result
8 | libes (C interface)->ESConn:Connect to DB
9 | database ElasticSearch
10 | ESConn->ElasticSearch:Get
11 | ElasticSearch->ESConn:data
12 | ESConn->libes (C interface):DB Connection Result
13 | libes (C interface)->psqlodbc Driver:ESConn object with DB Connection
14 | psqlodbc Driver->ODBCTest:SQL Code Result
--------------------------------------------------------------------------------
/docs/dev/sequence_diagrams/SQLExecDirect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/dev/sequence_diagrams/SQLExecDirect.png
--------------------------------------------------------------------------------
/docs/dev/sequence_diagrams/SQLExecDirect.txt:
--------------------------------------------------------------------------------
1 | Title SQLExecDirect Sequence Diagram
2 | ODBCTest->psqlodbc Driver:SQLExecDirect
3 | psqlodbc Driver->libes (C interface):Query
4 | libes (C interface)->libes (C interface):Active Connection
5 | libes (C interface)->ESConn:Connection, Query
6 | ESConn->ESConn:Connection, Query validation
7 | database ElasticSearch
8 | ESConn->ElasticSearch:Post
9 | ElasticSearch->ESConn:Data
10 | ESConn->libes (C interface):Data
11 | libes (C interface)->psqlodbc Driver:Data
12 | psqlodbc Driver->ODBCTest:Query Execution Status
--------------------------------------------------------------------------------
/docs/test/excel_connection.md:
--------------------------------------------------------------------------------
1 | # Testing Microsoft Excel Connection
2 |
3 | ## Prerequisites
4 | * [Download and install](../../README.md) Open Distro for Elasticsearch SQL ODBC Driver.
5 | * [Install and configure](https://opendistro.github.io/for-elasticsearch-docs/docs/install/) Open Distro for Elasticsearch.
6 | * Open ODBC Data Source Administrator. Click on **System DSN** > **ODFE SQL ODBC DSN** > **Configure**.
7 | * Set all connection options & Click on **Test**. Connection test should return `Connection Successful`.
8 |
9 | ## Microsoft Excel Connectivity
10 |
11 | There are multiple ways to load data from Elasticsearch in Microsoft Excel.
12 | * [ODBC as Data Source](odbc_data_source_connection.md)
13 | * [Microsoft Query](microsoft_query_connection.md)
14 | * [Query Wizard](query_wizard_connection.md)
15 |
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_advanced_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_advanced_options.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_advanced_options_auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_advanced_options_auth.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_advanced_options_load_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_advanced_options_load_data.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_auth.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_dsn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_dsn.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_loaded_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_loaded_data.png
--------------------------------------------------------------------------------
/docs/test/img/from_odbc_table_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/from_odbc_table_list.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_add_tables.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_add_tables.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_disable_use_the_query_wizard_option.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_disable_use_the_query_wizard_option.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_import_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_import_data.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_loaded_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_loaded_data.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_select_colums.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_select_colums.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_select_tables.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_select_tables.png
--------------------------------------------------------------------------------
/docs/test/img/microsoft_query_table_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/microsoft_query_table_options.png
--------------------------------------------------------------------------------
/docs/test/img/odbc_data_source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/odbc_data_source.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_choose_coulms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_choose_coulms.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_enable_use_the_query_wizard_option.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_enable_use_the_query_wizard_option.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_error_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_error_popup.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_filter_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_filter_data.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_finish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_finish.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_import_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_import_data.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_loaded_data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_loaded_data.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_select_tables.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_select_tables.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_sort_order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_sort_order.png
--------------------------------------------------------------------------------
/docs/test/img/query_wizard_table_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/query_wizard_table_options.png
--------------------------------------------------------------------------------
/docs/test/img/select_microsoft_query.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/test/img/select_microsoft_query.png
--------------------------------------------------------------------------------
/docs/test/microsoft_query_connection.md:
--------------------------------------------------------------------------------
1 | ## Microsoft Query Connection
2 |
3 | * Open blank workbook in Microsoft Excel.
4 | * Click on **Data** > **Get Data** > **From Other Sources** > **From Microsoft Query**
5 |
6 |
7 |
8 | * Select **Databases** > **ODFE SQL ODBC DSN**.
9 | * Clear the **Use the Query Wizard to create/edit queries** check box, and then click on **OK**.
10 |
11 |
12 |
13 | * Click on **Options** in Add Table window.
14 |
15 |
16 |
17 | * Click **Refresh**. Select checkbox **Tables**. Clear all other checkboxes. Click on **OK**.
18 |
19 |
20 |
21 | * Select tables and click on **Add**. After all required tables are added, click on **Close**.
22 |
23 |
24 |
25 | * Double click on required columns. You can double-click the asterisk (*) to select all the columns from a table.
26 |
27 |
28 |
29 | * You can select different options to define query here. Ensure the query is supported by the [OpenDistro for Elasticsearch SQL plugin](https://github.com/opendistro-for-elasticsearch/sql). After defining query, click on **Return Data** to retrieve the result set.
30 | * Select worksheet and click on **OK**.
31 |
32 |
33 |
34 | * Data will be loaded in the spreadsheet
35 |
36 |
37 |
--------------------------------------------------------------------------------
/docs/test/odbc_data_source_connection.md:
--------------------------------------------------------------------------------
1 | ## ODBC as Data Source Connection
2 |
3 | * Open blank workbook in Microsoft Excel.
4 | * Click on **Data** > **Get Data** > **From Other Sources** > **From ODBC**
5 |
6 |
7 |
8 | * Select **ODFE SQL ODBC DSN**. Click **OK**.
9 |
10 |
11 |
12 | * Select **Default or Custom** in connection credentials windows and click on **Connect**.
13 |
14 |
15 |
16 | * Select a table from list to load data preview. Click on **Load**.
17 |
18 |
19 |
20 | #### Test Advanced options
21 |
22 | * Click on **Advanced options** after selecting DSN.
23 | * Add some connection options in **Connection string**.
24 | * Enter any supported **SQL statement**.
25 |
26 |
27 |
28 | * Click on **OK**.
29 | * Select Default option for authentication and Click on **Connect**.
30 |
31 |
32 |
33 | * Data preview should be available. **Load** data in spreadsheet.
34 |
35 |
36 |
37 | * Data will be loaded in the spreadsheet
38 |
39 |
40 |
41 | NOTE: Check driver logs for verify modified connection string options.
42 |
--------------------------------------------------------------------------------
/docs/test/query_wizard_connection.md:
--------------------------------------------------------------------------------
1 | ## Query Wizard Connection
2 |
3 | * Open blank workbook in Microsoft Excel.
4 | * Click on **Data** > **Get Data** > **From Other Sources** > **From Microsoft Query**
5 |
6 |
7 |
8 | * Select **Databases** > **ODFE SQL ODBC DSN**.
9 | * Ensure the **Use the Query Wizard to create/edit queries** check box is selected, and then click **OK**.
10 |
11 |
12 |
13 | * You might get an popup with a message `This data source contains no visible tables`. Click on **OK**.
14 |
15 |
16 |
17 | * Click on **Options** in Query Wizard window.
18 |
19 |
20 |
21 | * Select checkbox **Tables**. Clear all other checkboxes. Click on **OK**.
22 |
23 |
24 |
25 | * You will see list of available tables & columns. Select required tables/columns and click on **>**.
26 | * After selecting all required columns, Click on **Next**.
27 |
28 |
29 |
30 | * Specify conditions to apply filter if needed. Ensure selected operations are supported by Elasticsearch. Click on **Next**.
31 |
32 |
33 |
34 | * Specify sorting options if required. Ensure selected operations are supported by the [OpenDistro for Elasticsearch SQL plugin](https://github.com/opendistro-for-elasticsearch/sql). Click on **Next**.
35 |
36 |
37 |
38 | * Select **Return Data to Microsoft Excel** and click on **Finish**.
39 |
40 |
41 |
42 | * Select worksheet and click on **OK**.
43 |
44 |
45 |
46 | * Data will be loaded in the spreadsheet
47 |
48 |
49 |
--------------------------------------------------------------------------------
/docs/user/configuration_options.md:
--------------------------------------------------------------------------------
1 | # Configuration Options
2 |
3 | >**NOTE:** All option names are *case-insensitive*.
4 |
5 | #### Basic Options
6 |
7 | | Option | Description | Type | Default |
8 | |--------|-------------|------|---------------|
9 | | `DSN` | **D**ata **S**ource **N**ame used for configuring the connection. | string | |
10 | | `Host` / `Server` | Hostname or IP address for the target cluster. | string | |
11 | | `Port` | Port number on which the cluster's REST interface is listening. | string | |
12 |
13 | #### Authentication Options
14 |
15 | | Option | Description | Type | Default |
16 | |--------|-------------|------|---------------|
17 | | `Auth` | Authentication mechanism to use. | one of `BASIC` (basic HTTP), `AWS_SIGV4` (AWS auth), `NONE` | `NONE`
18 | | `User` / `UID` | [`Auth=BASIC`] Username for the connection. | string | |
19 | | `Password` / `PWD` | [`Auth=BASIC`] Password for the connection. | string | |
20 | | `Region` | [`Auth=AWS_SIGV4`] Region used for signing requests | AWS region (eg. `us-west-1`) | |
21 |
22 | #### Advanced Options
23 |
24 | | Option | Description | Type | Default |
25 | |--------|-------------|------|---------------|
26 | | `UseSSL` | Whether to establish the connection over SSL/TLS | boolean (`0` or `1`) | false (`0`) |
27 | | `HostnameVerification` | Indicate whether certificate hostname verification should be performed for an SSL/TLS connection. | boolean (`0` or `1`) | true (`1`) |
28 | | `ResponseTimeout` | The maximum time to wait for responses from the `Host`, in seconds. | integer | `10` |
29 |
30 | #### Logging Options
31 |
32 | | Option | Description | Type | Default |
33 | |--------|-------------|------|---------------|
34 | | `LogLevel` | Severity level for driver logs. | one of `ES_OFF`, `ES_FATAL`, `ES_ERROR`, `ES_INFO`, `ES_DEBUG`, `ES_TRACE`, `ES_ALL` | `ES_WARNING` |
35 | | `LogOutput` | Location for storing driver logs. | string | WIN: `C:\`, MAC: `/tmp` |
36 |
37 | **NOTE:** Administrative privileges are required to change the value of logging options on Windows.
--------------------------------------------------------------------------------
/docs/user/img/driver_default_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/user/img/driver_default_config.png
--------------------------------------------------------------------------------
/docs/user/img/dsn_default_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/docs/user/img/dsn_default_config.png
--------------------------------------------------------------------------------
/docs/user/mac_configure_dsn.md:
--------------------------------------------------------------------------------
1 | # Configuring a DSN on Mac
2 |
3 | > NOTE: iODBC Administrator is included with the [iODBC Driver Manager](http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads), which must be installed in order to use the driver on Mac.
4 |
5 | 1. Open **iODBC Administrator** using the following command (this gives the application permissions to save the Driver & DSN configurations):
6 | 1. `sudo /Applications/iODBC/iODBC\ Administrator64.app/Contents/MacOS/iODBC\ Administrator64`
7 |
8 | ## Adding a Driver Entry
9 |
10 | Note: In order to use the Open Distro for Elasticsearch SQL ODBC driver with the [Tableau Connector](), the **Description of the Driver** field *must* start with `ODFE SQL ODBC`.
11 |
12 | 1. Go to the **ODBC Drivers** tab.
13 | 2. Click **Add a Driver**.
14 | * **Description of the Driver**: The driver name used for ODBC connections (ex. `ODFE SQL ODBC Driver`)
15 | * **Driver File Name**: The path to the driver file (default installed path: `/usr/local/lib/odfesqlodbc/bin/libodfesqlodbc.dylib`)
16 | * **Setup File Name**: The path to the driver file (default installed path: `/usr/local/lib/odfesqlodbc/bin/libodfesqlodbc.dylib`)
17 | * Set as a **User** driver
18 | * Below is a screenshot of how the final screen should look.
19 | 3. Click **OK** to save the options.
20 |
21 |
22 |
23 |
24 |
25 | ## Adding a DSN Entry
26 |
27 | This is not required if you are using the Tableau Connector, but will help with connecting to your data source through other applications.
28 |
29 | 1. Go to the **User DSN** tab
30 | 2. Select **Add** on the right side of the window.
31 | * Choose the Driver you added above.
32 | * **Data Source Name (DSN)**: The name of the DSN used to store connection options (ex. `ODFE SQL ODBC DSN`)
33 | * **Comment**: Not required
34 | * Add key-value pairs by using the **'+'** button. Below is a picture of the recommended set of options for a default local Open Distro for Elasticsearch installation.
35 | 3. Click **OK** to save the DSN configuration.
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin/Microsoft.DTfW.DHL.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin/dbghelp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/bin/dbghelp.dll
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin/vld_x86.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/bin/vld_x86.dll
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin64/Microsoft.DTfW.DHL.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin64/dbghelp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/bin64/dbghelp.dll
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/bin64/vld_x64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/bin64/vld_x64.dll
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/include/vld_def.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Visual Leak Detector - Import Library Header
4 | // Copyright (c) 2005-2014 VLD Team
5 | //
6 | // This library is free software; you can redistribute it and/or
7 | // modify it under the terms of the GNU Lesser General Public
8 | // License as published by the Free Software Foundation; either
9 | // version 2.1 of the License, or (at your option) any later version.
10 | //
11 | // This library is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | // Lesser General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser General Public
17 | // License along with this library; if not, write to the Free Software
18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 | //
20 | // See COPYING.txt for the full terms of the GNU Lesser General Public License.
21 | //
22 | ////////////////////////////////////////////////////////////////////////////////
23 |
24 | #pragma once
25 |
26 | #ifndef _WCHAR_T_DEFINED
27 | # include
28 | #endif
29 |
30 | #define VLD_OPT_AGGREGATE_DUPLICATES 0x0001 // If set, aggregate duplicate leaks in the leak report.
31 | #define VLD_OPT_MODULE_LIST_INCLUDE 0x0002 // If set, modules in the module list are included, all others are excluded.
32 | #define VLD_OPT_REPORT_TO_DEBUGGER 0x0004 // If set, the memory leak report is sent to the debugger.
33 | #define VLD_OPT_REPORT_TO_FILE 0x0008 // If set, the memory leak report is sent to a file.
34 | #define VLD_OPT_SAFE_STACK_WALK 0x0010 // If set, the stack is walked using the "safe" method (StackWalk64).
35 | #define VLD_OPT_SELF_TEST 0x0020 // If set, perform a self-test to verify memory leak self-checking.
36 | #define VLD_OPT_SLOW_DEBUGGER_DUMP 0x0040 // If set, inserts a slight delay between sending output to the debugger.
37 | #define VLD_OPT_START_DISABLED 0x0080 // If set, memory leak detection will initially disabled.
38 | #define VLD_OPT_TRACE_INTERNAL_FRAMES 0x0100 // If set, include useless frames (e.g. internal to VLD) in call stacks.
39 | #define VLD_OPT_UNICODE_REPORT 0x0200 // If set, the leak report will be encoded UTF-16 instead of ASCII.
40 | #define VLD_OPT_VLDOFF 0x0400 // If set, VLD will be completely deactivated. It will not attach to any modules.
41 | #define VLD_OPT_REPORT_TO_STDOUT 0x0800 // If set, the memory leak report is sent to stdout.
42 | #define VLD_OPT_SKIP_HEAPFREE_LEAKS 0x1000 // If set, VLD skip HeapFree memory leaks.
43 | #define VLD_OPT_VALIDATE_HEAPFREE 0x2000 // If set, VLD verifies and reports heap consistency for HeapFree calls.
44 | #define VLD_OPT_SKIP_CRTSTARTUP_LEAKS 0x4000 // If set, VLD skip crt srtartup memory leaks.
45 |
46 | #define VLD_RPTHOOK_INSTALL 0
47 | #define VLD_RPTHOOK_REMOVE 1
48 |
49 | typedef int (__cdecl * VLD_REPORT_HOOK)(int reportType, wchar_t *message, int *returnValue);
50 |
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/lib/vld.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/lib/vld.lib
--------------------------------------------------------------------------------
/libraries/VisualLeakDetector/lib64/vld.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/libraries/VisualLeakDetector/lib64/vld.lib
--------------------------------------------------------------------------------
/libraries/rabbit/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2014 mashiro
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/libraries/rabbit/README:
--------------------------------------------------------------------------------
1 | Downloaded on November 18th, 2019 @ 9:40 am
2 | Master branch
3 | https://github.com/mashiro/rabbit/tree/master
4 |
5 | - lyndonb@bitquilltech.com
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/internal/ieee754.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_IEEE754_
16 | #define RAPIDJSON_IEEE754_
17 |
18 | #include "../rapidjson.h"
19 |
20 | RAPIDJSON_NAMESPACE_BEGIN
21 | namespace internal {
22 |
23 | class Double {
24 | public:
25 | Double() {}
26 | Double(double d) : d_(d) {}
27 | Double(uint64_t u) : u_(u) {}
28 |
29 | double Value() const { return d_; }
30 | uint64_t Uint64Value() const { return u_; }
31 |
32 | double NextPositiveDouble() const {
33 | RAPIDJSON_ASSERT(!Sign());
34 | return Double(u_ + 1).Value();
35 | }
36 |
37 | bool Sign() const { return (u_ & kSignMask) != 0; }
38 | uint64_t Significand() const { return u_ & kSignificandMask; }
39 | int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); }
40 |
41 | bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; }
42 | bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; }
43 | bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; }
44 | bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; }
45 | bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; }
46 |
47 | uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); }
48 | int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; }
49 | uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; }
50 |
51 | static unsigned EffectiveSignificandSize(int order) {
52 | if (order >= -1021)
53 | return 53;
54 | else if (order <= -1074)
55 | return 0;
56 | else
57 | return static_cast(order) + 1074;
58 | }
59 |
60 | private:
61 | static const int kSignificandSize = 52;
62 | static const int kExponentBias = 0x3FF;
63 | static const int kDenormalExponent = 1 - kExponentBias;
64 | static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000);
65 | static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
66 | static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
67 | static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
68 |
69 | union {
70 | double d_;
71 | uint64_t u_;
72 | };
73 | };
74 |
75 | } // namespace internal
76 | RAPIDJSON_NAMESPACE_END
77 |
78 | #endif // RAPIDJSON_IEEE754_
79 |
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/internal/strfunc.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_
17 |
18 | #include "../stream.h"
19 |
20 | RAPIDJSON_NAMESPACE_BEGIN
21 | namespace internal {
22 |
23 | //! Custom strlen() which works on different character types.
24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short)
25 | \param s Null-terminated input string.
26 | \return Number of characters in the string.
27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
28 | */
29 | template
30 | inline SizeType StrLen(const Ch* s) {
31 | const Ch* p = s;
32 | while (*p) ++p;
33 | return SizeType(p - s);
34 | }
35 |
36 | //! Returns number of code points in a encoded string.
37 | template
38 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
39 | GenericStringStream is(s);
40 | const typename Encoding::Ch* end = s + length;
41 | SizeType count = 0;
42 | while (is.src_ < end) {
43 | unsigned codepoint;
44 | if (!Encoding::Decode(is, &codepoint))
45 | return false;
46 | count++;
47 | }
48 | *outCount = count;
49 | return true;
50 | }
51 |
52 | } // namespace internal
53 | RAPIDJSON_NAMESPACE_END
54 |
55 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_
56 |
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/internal/swap.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_
16 | #define RAPIDJSON_INTERNAL_SWAP_H_
17 |
18 | #include "../rapidjson.h"
19 |
20 | #if defined(__clang__)
21 | RAPIDJSON_DIAG_PUSH
22 | RAPIDJSON_DIAG_OFF(c++98-compat)
23 | #endif
24 |
25 | RAPIDJSON_NAMESPACE_BEGIN
26 | namespace internal {
27 |
28 | //! Custom swap() to avoid dependency on C++ header
29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only.
30 | \note This has the same semantics as std::swap().
31 | */
32 | template
33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT {
34 | T tmp = a;
35 | a = b;
36 | b = tmp;
37 | }
38 |
39 | } // namespace internal
40 | RAPIDJSON_NAMESPACE_END
41 |
42 | #if defined(__clang__)
43 | RAPIDJSON_DIAG_POP
44 | #endif
45 |
46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_
47 |
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/memorybuffer.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_
16 | #define RAPIDJSON_MEMORYBUFFER_H_
17 |
18 | #include "stream.h"
19 | #include "internal/stack.h"
20 |
21 | RAPIDJSON_NAMESPACE_BEGIN
22 |
23 | //! Represents an in-memory output byte stream.
24 | /*!
25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
26 |
27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
28 |
29 | Differences between MemoryBuffer and StringBuffer:
30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
32 |
33 | \tparam Allocator type for allocating memory buffer.
34 | \note implements Stream concept
35 | */
36 | template
37 | struct GenericMemoryBuffer {
38 | typedef char Ch; // byte
39 |
40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
41 |
42 | void Put(Ch c) { *stack_.template Push() = c; }
43 | void Flush() {}
44 |
45 | void Clear() { stack_.Clear(); }
46 | void ShrinkToFit() { stack_.ShrinkToFit(); }
47 | Ch* Push(size_t count) { return stack_.template Push(count); }
48 | void Pop(size_t count) { stack_.template Pop(count); }
49 |
50 | const Ch* GetBuffer() const {
51 | return stack_.template Bottom();
52 | }
53 |
54 | size_t GetSize() const { return stack_.GetSize(); }
55 |
56 | static const size_t kDefaultCapacity = 256;
57 | mutable internal::Stack stack_;
58 | };
59 |
60 | typedef GenericMemoryBuffer<> MemoryBuffer;
61 |
62 | //! Implement specialized version of PutN() with memset() for better performance.
63 | template<>
64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c));
66 | }
67 |
68 | RAPIDJSON_NAMESPACE_END
69 |
70 | #endif // RAPIDJSON_MEMORYBUFFER_H_
71 |
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/memorystream.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_MEMORYSTREAM_H_
16 | #define RAPIDJSON_MEMORYSTREAM_H_
17 |
18 | #include "stream.h"
19 |
20 | #ifdef __clang__
21 | RAPIDJSON_DIAG_PUSH
22 | RAPIDJSON_DIAG_OFF(unreachable-code)
23 | RAPIDJSON_DIAG_OFF(missing-noreturn)
24 | #endif
25 |
26 | RAPIDJSON_NAMESPACE_BEGIN
27 |
28 | //! Represents an in-memory input byte stream.
29 | /*!
30 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream.
31 |
32 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file.
33 |
34 | Differences between MemoryStream and StringStream:
35 | 1. StringStream has encoding but MemoryStream is a byte stream.
36 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source.
37 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4().
38 | \note implements Stream concept
39 | */
40 | struct MemoryStream {
41 | typedef char Ch; // byte
42 |
43 | MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {}
44 |
45 | Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; }
46 | Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; }
47 | size_t Tell() const { return static_cast(src_ - begin_); }
48 |
49 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
50 | void Put(Ch) { RAPIDJSON_ASSERT(false); }
51 | void Flush() { RAPIDJSON_ASSERT(false); }
52 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
53 |
54 | // For encoding detection only.
55 | const Ch* Peek4() const {
56 | return Tell() + 4 <= size_ ? src_ : 0;
57 | }
58 |
59 | const Ch* src_; //!< Current read position.
60 | const Ch* begin_; //!< Original head of the string.
61 | const Ch* end_; //!< End of stream.
62 | size_t size_; //!< Size of the stream.
63 | };
64 |
65 | RAPIDJSON_NAMESPACE_END
66 |
67 | #ifdef __clang__
68 | RAPIDJSON_DIAG_POP
69 | #endif
70 |
71 | #endif // RAPIDJSON_MEMORYBUFFER_H_
72 |
--------------------------------------------------------------------------------
/libraries/rapidjson/include/rapidjson/ostreamwrapper.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_
16 | #define RAPIDJSON_OSTREAMWRAPPER_H_
17 |
18 | #include "stream.h"
19 | #include
20 |
21 | #ifdef __clang__
22 | RAPIDJSON_DIAG_PUSH
23 | RAPIDJSON_DIAG_OFF(padded)
24 | #endif
25 |
26 | RAPIDJSON_NAMESPACE_BEGIN
27 |
28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept.
29 | /*!
30 | The classes can be wrapped including but not limited to:
31 |
32 | - \c std::ostringstream
33 | - \c std::stringstream
34 | - \c std::wpstringstream
35 | - \c std::wstringstream
36 | - \c std::ifstream
37 | - \c std::fstream
38 | - \c std::wofstream
39 | - \c std::wfstream
40 |
41 | \tparam StreamType Class derived from \c std::basic_ostream.
42 | */
43 |
44 | template
45 | class BasicOStreamWrapper {
46 | public:
47 | typedef typename StreamType::char_type Ch;
48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {}
49 |
50 | void Put(Ch c) {
51 | stream_.put(c);
52 | }
53 |
54 | void Flush() {
55 | stream_.flush();
56 | }
57 |
58 | // Not implemented
59 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
60 | char Take() { RAPIDJSON_ASSERT(false); return 0; }
61 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
62 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
63 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
64 |
65 | private:
66 | BasicOStreamWrapper(const BasicOStreamWrapper&);
67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&);
68 |
69 | StreamType& stream_;
70 | };
71 |
72 | typedef BasicOStreamWrapper OStreamWrapper;
73 | typedef BasicOStreamWrapper WOStreamWrapper;
74 |
75 | #ifdef __clang__
76 | RAPIDJSON_DIAG_POP
77 | #endif
78 |
79 | RAPIDJSON_NAMESPACE_END
80 |
81 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_
82 |
--------------------------------------------------------------------------------
/opendistro-elasticsearch-odbc.release-notes.md:
--------------------------------------------------------------------------------
1 | ## 2020-05-05, Version 1.7
2 |
3 | ### Notable Changes
4 |
5 | This is the first release of OpenDistro For ELasticsearch ODBC driver.
6 |
7 | OpenDistro ODBC provides a driver for ODBC connectivity for OpenDistro SQL plugin. The driver has been developed from scratch and offers the following features in this initial release:
8 |
9 | * ODBC API implementation as per ODBC 3.51 specifications
10 | * Support for MacOS and Windows installers
11 | * Support for HTTP BASIC and AWS SIGV4 authentication mechanisms
12 | * Full support for Elasticsearch Datatypes: BOOLEAN, BYTE, SHORT, INTEGER, LONG, HALF_FLOAT, FLOAT, DOUBLE, SCALED_FLOAT, KEYWORD, TEXT
13 |
14 |
--------------------------------------------------------------------------------
/release-notes/sql-odbc.release-notes-1.7.0.0.md:
--------------------------------------------------------------------------------
1 | ## 2020-05-05, Version 1.7
2 |
3 | This is the first release of OpenDistro For ELasticsearch ODBC driver.
4 |
5 | OpenDistro ODBC provides a driver for ODBC connectivity for OpenDistro SQL plugin. The driver has been developed from scratch and offers the following features in this initial release:
6 |
7 | * ODBC API implementation as per ODBC 3.51 specifications
8 | * Support for MacOS and Windows installers
9 | * Support for HTTP BASIC and AWS SIGV4 authentication mechanisms
10 | * Full support for Elasticsearch Datatypes: BOOLEAN, BYTE, SHORT, INTEGER, LONG, HALF_FLOAT, FLOAT, DOUBLE, SCALED_FLOAT, KEYWORD, TEXT
11 |
12 | ### Features
13 |
14 | * Feature[#7](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/7): Add support for connection string abbreviations
15 |
16 | * Feature[#2](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/2): Connection string refactoring and registry updates
17 |
18 | * Feature[#27](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/27): Simple Windows Installer
19 |
20 |
21 | * Feature[#78](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/78): Add fetch_size for pagination support
22 |
23 |
24 | ### Documentation
25 |
26 | * [Pagination support design document](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/40)
27 | * [Update README for authentication & encryption configuration options](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/33)
28 | * [Instructions for signing installers](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/84)
29 |
30 |
31 |
32 | ### BugFixes
33 |
34 | * [Fix AWS authentication for Tableau on Mac](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/9)
35 |
36 | * [Mac installer fixes](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/73)
37 |
38 |
39 | * [Fix General installer components](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/69)
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/release-notes/sql-odbc.release-notes-1.8.0.0.md:
--------------------------------------------------------------------------------
1 | ## 2020-05-18, Version 1.8
2 |
3 | ### Features
4 |
5 | * Feature[#81](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/82): Add Tableau connector source files
6 |
7 | ### Documentation
8 |
9 | * [Add supported OS version in README.md](https://github.com/opendistro-for-elasticsearch/sql-odbc/pull/88)
10 |
--------------------------------------------------------------------------------
/release-notes/sql-odbc.release-notes-1.9.0.0.md:
--------------------------------------------------------------------------------
1 | ## 2020-06-24, Version 1.9
2 |
3 | ### Features
4 |
5 | * Feature [#96](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/96): Updating tableau connector files
6 | * Feature [#99](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/99): Add 32bit support for driver
7 | * Feature [#101](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/101): Pagination support
8 | * Feature [#107](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/107): Add support for building with code coverage
9 | * Feature [#109](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/109): Remove support for NOW in tableau connector
10 | * Feature [#112](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/112): Updating SQLRowCount function support
11 | * Feature [#114](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/114): Remove old driver files before installing Mac driver
12 | * Feature [#119](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/119): Add CAP_SUPPRESS_GET_SERVER_TIME instead of removing support for NOW() in tableau connector
13 | * Feature [#120](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/120): Use a queue which is created with a capacity while getting result pages
14 |
15 |
16 | ### Documentation
17 |
18 | * Documentation [#93](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/93): Update build instructions
19 | * Documentation [#116](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/116): Update README
20 |
21 | ### BugFixes
22 | * BugFix [#118](https:github.com/opendistro-for-elasticsearch/sql-odbc/pull/118): Fix ODBC administrator GUI on windows
23 |
--------------------------------------------------------------------------------
/run_cppcheck.bat:
--------------------------------------------------------------------------------
1 | ::
2 | :: Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | ::
4 | :: Licensed under the Apache License, Version 2.0 (the "License").
5 | :: You may not use this file except in compliance with the License.
6 | :: A copy of the License is located at
7 | ::
8 | :: http://www.apache.org/licenses/LICENSE-2.0
9 | ::
10 | :: or in the "license" file accompanying this file. This file is distributed
11 | :: on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | :: express or implied. See the License for the specific language governing
13 | :: permissions and limitations under the License.
14 | ::
15 |
16 | :: --force: force checks all define combinations (default max is 12)
17 | :: --suppress=objectIndex: seemingly false-positive (TODO: investigate this further)
18 | :: -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo
19 | cppcheck.exe --force --suppress=objectIndex -iaws-sdk-cpp .\src\ 2> cppcheck-results.log
--------------------------------------------------------------------------------
/run_cppcheck.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | RESULTS_FILE=cppcheck-results.log
4 |
5 | # --force: force checks all define combinations (default max is 12)
6 | # -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo
7 | # -UWIN32: do not check WIN32-defined codepaths; this would throw errors on Mac
8 | cppcheck --force -iaws-sdk-cpp -UWIN32 ./src 2> ${RESULTS_FILE}
9 |
10 | if [ -s ${RESULTS_FILE} ]; then
11 | echo "!! Cppcheck errors found! Check ${RESULTS_FILE} for details."
12 | exit 1
13 | else
14 | echo "No Cppcheck errors found."
15 | fi
--------------------------------------------------------------------------------
/run_test_runner.bat:
--------------------------------------------------------------------------------
1 | ::
2 | :: Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | ::
4 | :: Licensed under the Apache License, Version 2.0 (the "License").
5 | :: You may not use this file except in compliance with the License.
6 | :: A copy of the License is located at
7 | ::
8 | :: http://www.apache.org/licenses/LICENSE-2.0
9 | ::
10 | :: or in the "license" file accompanying this file. This file is distributed
11 | :: on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | :: express or implied. See the License for the specific language governing
13 | :: permissions and limitations under the License.
14 | ::
15 |
16 | set PROJECT_DIR=%CD%
17 | set TEST_RUNNER_DIR=%PROJECT_DIR%\src\TestRunner
18 | set WORKING_DIR=%PROJECT_DIR%\bin64\Release
19 |
20 | cd %WORKING_DIR%
21 |
22 | py -m pip install mako
23 |
24 | py %TEST_RUNNER_DIR%\test_runner.py -i %TEST_RUNNER_DIR%\mako_template.html -o test_output.html -e %TEST_RUNNER_DIR%\test_exclude_list.txt
25 |
26 | set ERROR_CODE=%ERRORLEVEL%
27 |
28 | cd %PROJECT_DIR%
29 |
30 | echo %ERROR_CODE%
31 |
32 | EXIT /b %ERROR_CODE%
--------------------------------------------------------------------------------
/run_test_runner.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License").
7 | # You may not use this file except in compliance with the License.
8 | # A copy of the License is located at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # or in the "license" file accompanying this file. This file is distributed
13 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14 | # express or implied. See the License for the specific language governing
15 | # permissions and limitations under the License.
16 | #
17 |
18 |
19 | PROJECT_DIR=$(pwd)
20 | TEST_RUNNER_DIR=${PROJECT_DIR}/src/TestRunner
21 | WORKING_DIR=${PROJECT_DIR}/bin64
22 |
23 | cd ${WORKING_DIR}
24 |
25 | pip3 install mako
26 |
27 | python3 ${TEST_RUNNER_DIR}/test_runner.py -i ${TEST_RUNNER_DIR}/mako_template.html -o ${PROJECT_DIR}/test_output.html -e ${TEST_RUNNER_DIR}/test_exclude_list.txt
28 |
29 | ERROR_CODE=$?
30 |
31 | cd ..
32 |
33 | exit ${ERROR_CODE}
34 |
--------------------------------------------------------------------------------
/src/DSNInstaller/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(dsn_installer)
17 |
18 | set(SOURCE_FILES dsn_installer.cpp)
19 |
20 | add_executable(dsn_installer ${SOURCE_FILES})
21 |
22 | target_link_libraries(dsn_installer iodbcinst)
23 | target_compile_definitions(dsn_installer PUBLIC _UNICODE UNICODE)
--------------------------------------------------------------------------------
/src/IntegrationTests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(integration_tests)
17 |
18 | set(HELPER_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCHelper")
19 | set(CATALOG_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCCatalog")
20 | set(CONNECTION_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCConnection")
21 | set(DESCRIPTOR_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCDescriptors")
22 | set(EXECUTION_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCExecution")
23 | set(INFO_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCInfo")
24 | set(RESULTS_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCResults")
25 | set(TABLEAU_QUERIES_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCTableauQueries")
26 | set(AWS_AUTH_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCAwsAuth")
27 | set(PAGINATION_ITEST "${CMAKE_CURRENT_SOURCE_DIR}/ITODBCPagination")
28 |
29 | # Projects to build
30 | add_subdirectory(${HELPER_ITEST})
31 | add_subdirectory(${CATALOG_ITEST})
32 | add_subdirectory(${CONNECTION_ITEST})
33 | add_subdirectory(${DESCRIPTOR_ITEST})
34 | add_subdirectory(${EXECUTION_ITEST})
35 | add_subdirectory(${INFO_ITEST})
36 | add_subdirectory(${RESULTS_ITEST})
37 | add_subdirectory(${TABLEAU_QUERIES_ITEST})
38 | add_subdirectory(${AWS_AUTH_ITEST})
39 | add_subdirectory(${PAGINATION_ITEST})
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_aws_auth)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_aws_auth.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC}
24 | ${AWSSDK_INCLUDE_DIR}
25 | )
26 |
27 | # Generate executable
28 | add_executable(itodbc_aws_auth ${SOURCE_FILES})
29 |
30 | # Library dependencies
31 | target_link_libraries(itodbc_aws_auth odfesqlodbc itodbc_helper ut_helper gtest_main aws-cpp-sdk-core)
32 | target_compile_definitions(itodbc_aws_auth PUBLIC _UNICODE UNICODE)
33 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | //
18 | // pch.cpp
19 | // Include the standard header and generate the precompiled header.
20 | //
21 |
22 | #include "pch.h"
23 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | //
18 | // pch.h
19 | // Header for standard system include files.
20 | //
21 |
22 | #pragma once
23 |
24 | #include "gtest/gtest.h"
25 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/test_aws_auth_dsn.reg:
--------------------------------------------------------------------------------
1 | Windows Registry Editor Version 5.00
2 |
3 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
4 | "ElasticsearchODBC"="Installed"
5 |
6 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ElasticsearchODBC]
7 | "Driver"="\\bin64\\Release\\odfesqlodbc.dll"
8 | "Setup"="\\bin64\\Release\\odfesqlodbc.dll"
9 |
10 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
11 | "test_aws_auth_dsn"="ElasticsearchODBC"
12 |
13 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\test_aws_auth_dsn]
14 | "host"="https://search-sept-cdg-david-test-domain-gouok3seqeupz64smuvfxyddui.eu-west-3.es.amazonaws.com"
15 | "auth"="AWS_SIGV4"
16 | "region"="eu-west-3"
17 | "useSSL"="0"
18 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/test_odbc.ini:
--------------------------------------------------------------------------------
1 | [ODBC Data Sources]
2 | test_aws_auth_dsn = ElasticsearchODBC
3 |
4 | [test_aws_auth_dsn]
5 | host = https://search-sept-cdg-david-test-domain-gouok3seqeupz64smuvfxyddui.eu-west-3.es.amazonaws.com
6 | auth = AWS_SIGV4
7 | region = eu-west-3
8 | useSSL = 0
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCAwsAuth/test_odbcinst.ini:
--------------------------------------------------------------------------------
1 | [ODBC Drivers]
2 | ElasticsearchODBC = Installed
3 |
4 | [ElasticsearchODBC]
5 | Driver = /lib64/libodfesqlodbc.dylib
6 | Setup = /lib64/libodfesqlodbc.dylib
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCCatalog/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_catalog)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_catalog.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_catalog ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_catalog PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_catalog odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_catalog PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCCatalog/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCCatalog/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCCatalog/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_connection)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_connection.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_connection ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_connection PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_connection odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_connection PUBLIC _UNICODE UNICODE)
32 |
33 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/test_dsn.reg:
--------------------------------------------------------------------------------
1 | Windows Registry Editor Version 5.00
2 |
3 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]
4 | "ElasticsearchODBC"="Installed"
5 |
6 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ElasticsearchODBC]
7 | "Driver"="\\bin64\\Release\\odfesqlodbc.dll"
8 | "Setup"="\\bin64\\Release\\odfesqlodbc.dll"
9 |
10 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
11 | "test_dsn"="ElasticsearchODBC"
12 |
13 | [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\test_dsn]
14 | "host"="localhost"
15 | "port"="9200"
16 | "user"="admin"
17 | "password"="admin"
18 | "auth"="BASIC"
19 | "useSSL"="0"
20 | "responseTimeout"="10"
21 |
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/test_odbc.ini:
--------------------------------------------------------------------------------
1 | [ODBC Data Sources]
2 | test_dsn = ElasticsearchODBC
3 |
4 | [test_dsn]
5 | host = localhost
6 | port = 9200
7 | user = admin
8 | password = admin
9 | auth = BASIC
10 | useSSL = 0
11 | responseTimeout = 10
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCConnection/test_odbcinst.ini:
--------------------------------------------------------------------------------
1 | [ODBC Drivers]
2 | ElasticsearchODBC = Installed
3 |
4 | [ElasticsearchODBC]
5 | Driver = /lib64/libodfesqlodbc.dylib
6 | Setup = /lib64/libodfesqlodbc.dylib
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCDescriptors/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_descriptors)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_descriptors.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_descriptors ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_descriptors PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_descriptors odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_descriptors PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCDescriptors/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCDescriptors/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCDescriptors/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCExecution/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_execution)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_execution.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_execution ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_link_libraries(itodbc_execution odfesqlodbc itodbc_helper ut_helper gtest_main)
30 | target_compile_definitions(itodbc_execution PUBLIC _UNICODE UNICODE)
31 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCExecution/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCExecution/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCHelper/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_helper)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES it_odbc_helper.cpp)
20 | set(HEADER_FILES it_odbc_helper.h)
21 | include_directories(
22 | ${UT_HELPER}
23 | ${ODFEODBC_SRC}
24 | ${VLD_SRC}
25 | )
26 |
27 | # Generate dll (SHARED)
28 | add_library(itodbc_helper SHARED ${SOURCE_FILES} ${HEADER_FILES})
29 |
30 | # Library dependencies
31 | target_link_libraries(itodbc_helper odfesqlodbc ut_helper gtest_main)
32 | target_compile_definitions(itodbc_helper PUBLIC _UNICODE UNICODE)
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCInfo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_info)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_info.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_info ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_info PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_info odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_info PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCInfo/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCInfo/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCInfo/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCPagination/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_pagination)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_pagination.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_pagination ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_pagination PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_pagination odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_pagination PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCPagination/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCPagination/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCPagination/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCResults/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_results)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_results.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_results ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_results PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_results odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_results PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCResults/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCResults/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCResults/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCTableauQueries/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(itodbc_tableau_queries)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_odbc_tableau_queries.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(itodbc_tableau_queries ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_code_coverage(itodbc_tableau_queries PUBLIC AUTO ALL)
30 | target_link_libraries(itodbc_tableau_queries odfesqlodbc itodbc_helper ut_helper gtest_main)
31 | target_compile_definitions(itodbc_tableau_queries PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCTableauQueries/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCTableauQueries/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/IntegrationTests/ITODBCTableauQueries/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/PerformanceTests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(performance_tests)
17 |
18 | set(RESULTS_PTESTS "${CMAKE_CURRENT_SOURCE_DIR}/PTODBCResults")
19 | set(INFO_PTESTS "${CMAKE_CURRENT_SOURCE_DIR}/PTODBCInfo")
20 | set(EXECUTION_PTESTS "${CMAKE_CURRENT_SOURCE_DIR}/PTODBCExecution")
21 |
22 | # Projects to build
23 | add_subdirectory(${RESULTS_PTESTS})
24 | add_subdirectory(${INFO_PTESTS})
25 | add_subdirectory(${EXECUTION_PTESTS})
26 |
27 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCExecution/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(performance_execution)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES performance_odbc_execution.cpp)
20 | include_directories(${ODFEODBC_SRC})
21 |
22 | # Generate executable
23 | add_executable(performance_execution ${SOURCE_FILES})
24 |
25 | # Library dependencies
26 | target_link_libraries(performance_execution odfesqlodbc)
27 | target_compile_definitions(performance_execution PUBLIC _UNICODE UNICODE)
28 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCExecution/performance_odbc_execution.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | // clang-format off
18 | #include "chrono"
19 | #include
20 | #include
21 | #include
22 | #include
23 | // clang-format on
24 | #define IT_SIZEOF(x) (NULL == (x) ? 0 : (sizeof((x)) / sizeof((x)[0])))
25 | #define ITERATION_COUNT 12
26 | std::wstring dsn_name = L"DSN=test_dsn";
27 | const wchar_t* const query = L"SELECT * FROM kibana_sample_data_flights limit 10000";
28 |
29 | int Setup(SQLHENV* env, SQLHDBC* conn, SQLHSTMT* hstmt) {
30 | SQLTCHAR out_conn_string[1024];
31 | SQLSMALLINT out_conn_string_length;
32 | if (SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, env))
33 | && SQL_SUCCEEDED(SQLSetEnvAttr(*env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0))
34 | && SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_DBC, *env, conn))
35 | && SQL_SUCCEEDED(SQLDriverConnect(*conn, NULL, (SQLTCHAR*)dsn_name.c_str(), SQL_NTS,
36 | out_conn_string, IT_SIZEOF(out_conn_string),
37 | &out_conn_string_length, SQL_DRIVER_COMPLETE))
38 | && SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_STMT, *conn, hstmt))) {
39 | return SQL_SUCCESS;
40 | }
41 | return SQL_ERROR;
42 | }
43 |
44 | void Teardown(SQLHDBC* conn, SQLHENV* env) {
45 | SQLDisconnect(*conn);
46 | SQLFreeHandle(SQL_HANDLE_ENV, *env);
47 | }
48 |
49 | int QueryExecutionTime() {
50 | SQLRETURN ret = SQL_ERROR;
51 | try {
52 | SQLHENV env = SQL_NULL_HENV;
53 | SQLHDBC conn = SQL_NULL_HDBC;
54 | SQLHSTMT hstmt = SQL_NULL_HSTMT;
55 | if (SQL_SUCCEEDED(Setup(&env, &conn, &hstmt))) {
56 | std::cout << "Time(ms) for query execution:" << std::endl;
57 | for (int i = 0; i < ITERATION_COUNT; i++) {
58 | // Calculate time(ms) for query execution
59 | auto start = std::chrono::steady_clock::now();
60 | ret = SQLExecDirect(hstmt, (SQLTCHAR*)query, SQL_NTS);
61 | auto end = std::chrono::steady_clock::now();
62 | std::cout<< std::chrono::duration_cast< std::chrono::milliseconds >(
63 | end - start).count()<< std::endl;
64 | SQLCloseCursor(hstmt);
65 | }
66 | Teardown(&conn, &env);
67 | }
68 | } catch (...) {
69 | std::cout << "Exception occurred" << std::endl;
70 | }
71 | return ret;
72 | }
73 |
74 | int main() {
75 | return QueryExecutionTime();
76 | }
77 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCInfo/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(performance_info)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES performance_odbc_info.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC}
24 | ${RABBIT_SRC}
25 | ${RAPIDJSON_SRC})
26 |
27 | # Generate executable
28 | add_executable(performance_info ${SOURCE_FILES})
29 |
30 | # Library dependencies
31 | target_link_libraries(performance_info odfesqlodbc itodbc_helper ut_helper gtest_main)
32 | target_compile_definitions(performance_info PUBLIC _UNICODE UNICODE)
33 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCInfo/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCInfo/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCInfo/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCResults/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(performance_results)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES performance_odbc_results.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${IT_HELPER}
22 | ${ODFEODBC_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(performance_results ${SOURCE_FILES})
27 |
28 | # Library dependencies
29 | target_link_libraries(performance_results odfesqlodbc itodbc_helper ut_helper gtest_main)
30 | target_compile_definitions(performance_results PUBLIC _UNICODE UNICODE)
31 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCResults/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCResults/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/PerformanceTests/PTODBCResults/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/README.md:
--------------------------------------------------------------------------------
1 | ## odfe_sql_odbc
2 |
3 | The connector files in `odfe_sql_odbc` can be used to connect to elasticsearch server in Tableau.
4 |
5 | * These connector files remove and modify a set of unsupported functions and operations.
6 | * It includes set of capabilities to customize and tune connector behavior
7 |
8 | To use this connector with Tableau, [Package the connector](https://tableau.github.io/connector-plugin-sdk/docs/package-sign) and [Run Packaged Connector (TACO file)](https://tableau.github.io/connector-plugin-sdk/docs/run-taco)
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/connection-dialog.tcd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/connectionBuilder.js:
--------------------------------------------------------------------------------
1 | (function dsbuilder(attr){
2 | var params = {};
3 |
4 | // Set host information in connection string
5 | params["SERVER"] = attr[connectionHelper.attributeServer];
6 | params["PORT"] = attr[connectionHelper.attributePort];
7 |
8 | // Set authentication values in connection string
9 | var authAttrValue = attr[connectionHelper.attributeAuthentication];
10 | params["Auth"] = attr[connectionHelper.attributeAuthentication];
11 | if (authAttrValue == "AWS_SIGV4"){
12 | params["Region"] = attr[connectionHelper.attributeVendor1];
13 | } else if (authAttrValue == "BASIC"){
14 | params["UID"] = attr[connectionHelper.attributeUsername];
15 | params["PWD"] = attr[connectionHelper.attributePassword];
16 | }
17 |
18 | // Set SSL value in connection string
19 | if (attr[connectionHelper.attributeSSLMode] == "require"){
20 | params["useSSL"] = "1";
21 | } else {
22 | params["useSSL"] = "0";
23 | }
24 |
25 | // Parse additional options and add in connection string
26 | var odbcConnectStringExtrasMap = {};
27 | const attributeODBCConnectStringExtras = "vendor2";
28 | if (attributeODBCConnectStringExtras in attr){
29 | odbcConnectStringExtrasMap = connectionHelper.ParseODBCConnectString(attr[attributeODBCConnectStringExtras]);
30 | }
31 | for (var key in odbcConnectStringExtrasMap){
32 | params[key] = odbcConnectStringExtrasMap[key];
33 | }
34 |
35 | // Format the attributes as 'key=value'
36 | var formattedParams = [];
37 | formattedParams.push(connectionHelper.formatKeyValuePair(driverLocator.keywordDriver, driverLocator.locateDriver(attr)));
38 | for (var key in params){
39 | formattedParams.push(connectionHelper.formatKeyValuePair(key, params[key]));
40 | }
41 | return formattedParams;
42 | })
43 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/connectionResolver.tdr:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | server
11 | port
12 | authentication
13 | username
14 | password
15 | sslmode
16 | vendor1
17 | vendor2
18 |
19 |
20 |
21 |
22 |
23 |
24 | ODFE SQL ODBC*
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc/odfe_sql_odbc.taco:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/TableauConnector/odfe_sql_odbc/odfe_sql_odbc.taco
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/README.md:
--------------------------------------------------------------------------------
1 | ## odfe_sql_odbc_dev
2 |
3 | The connector files in `odfe_sql_odbc_dev` can be used for development purposes.
4 |
5 | * Use this connector while running tdvt tests to identify the areas for improving query support.
6 | * These connector files do not remove or modify any dialect function.
7 | * It includes minimum set of capabilities required to connect to data source.
8 |
9 | To use this connector with Tableau, follow instructions at [Run Your "Under Development" Connector](https://tableau.github.io/connector-plugin-sdk/docs/share)
10 |
11 | To test this connector with TDVT, follow instructions at [Test with TDVT Suite](https://tableau.github.io/connector-plugin-sdk/docs/tdvt)
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/connection-dialog.tcd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/connectionBuilder.js:
--------------------------------------------------------------------------------
1 | (function dsbuilder(attr){
2 | var params = {};
3 |
4 | // Set host information in connection string
5 | params["SERVER"] = attr[connectionHelper.attributeServer];
6 | params["PORT"] = attr[connectionHelper.attributePort];
7 |
8 | // Set authentication values in connection string
9 | var authAttrValue = attr[connectionHelper.attributeAuthentication];
10 | params["Auth"] = attr[connectionHelper.attributeAuthentication];
11 | if (authAttrValue == "AWS_SIGV4"){
12 | params["Region"] = attr[connectionHelper.attributeVendor1];
13 | } else if (authAttrValue == "BASIC"){
14 | params["UID"] = attr[connectionHelper.attributeUsername];
15 | params["PWD"] = attr[connectionHelper.attributePassword];
16 | }
17 |
18 | // Set SSL value in connection string
19 | if (attr[connectionHelper.attributeSSLMode] == "require"){
20 | params["useSSL"] = "1";
21 | } else {
22 | params["useSSL"] = "0";
23 | }
24 |
25 | // Parse additional options and add in connection string
26 | var odbcConnectStringExtrasMap = {};
27 | const attributeODBCConnectStringExtras = "vendor2";
28 | if (attributeODBCConnectStringExtras in attr){
29 | odbcConnectStringExtrasMap = connectionHelper.ParseODBCConnectString(attr[attributeODBCConnectStringExtras]);
30 | }
31 | for (var key in odbcConnectStringExtrasMap){
32 | params[key] = odbcConnectStringExtrasMap[key];
33 | }
34 |
35 | // Format the attributes as 'key=value'
36 | var formattedParams = [];
37 | formattedParams.push(connectionHelper.formatKeyValuePair(driverLocator.keywordDriver, driverLocator.locateDriver(attr)));
38 | for (var key in params){
39 | formattedParams.push(connectionHelper.formatKeyValuePair(key, params[key]));
40 | }
41 | return formattedParams;
42 | })
43 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/connectionResolver.tdr:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | server
11 | port
12 | authentication
13 | username
14 | password
15 | sslmode
16 | vendor1
17 | vendor2
18 |
19 |
20 |
21 |
22 |
23 |
24 | ODFE SQL ODBC*
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/dialect.tdd:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/TableauConnector/odfe_sql_odbc_dev/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/TestRunner/test_exclude_list.txt:
--------------------------------------------------------------------------------
1 | ut_aws_sdk_cpp
2 | itodbc_aws_auth
--------------------------------------------------------------------------------
/src/UnitTests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(unit_tests)
17 |
18 | set(HELPER_UTEST "${CMAKE_CURRENT_SOURCE_DIR}/UTHelper")
19 | set(CONN_UTEST "${CMAKE_CURRENT_SOURCE_DIR}/UTConn")
20 | set(RABBIT_UTEST "${CMAKE_CURRENT_SOURCE_DIR}/UTRabbit")
21 | set(CRITICALSECTION_UTEST "${CMAKE_CURRENT_SOURCE_DIR}/UTCriticalSection")
22 | set(AWSSDKCPP_UTEST "${CMAKE_CURRENT_SOURCE_DIR}/UTAwsSdkCpp")
23 |
24 | # Projects to build
25 | add_subdirectory(${HELPER_UTEST})
26 | add_subdirectory(${CONN_UTEST})
27 | add_subdirectory(${RABBIT_UTEST})
28 | add_subdirectory(${CRITICALSECTION_UTEST})
29 | add_subdirectory(${AWSSDKCPP_UTEST})
--------------------------------------------------------------------------------
/src/UnitTests/GoogleTest.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2008, Google Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above
11 | copyright notice, this list of conditions and the following disclaimer
12 | in the documentation and/or other materials provided with the
13 | distribution.
14 | * Neither the name of Google Inc. nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/src/UnitTests/UTAwsSdkCpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(ut_aws_sdk_cpp)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_aws_sdk_cpp.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${AWSSDK_INCLUDE_DIR}
22 | ${VLD_SRC})
23 |
24 | # Generate executable
25 | add_executable(ut_aws_sdk_cpp ${SOURCE_FILES})
26 |
27 | # Library dependencies
28 | target_link_libraries(ut_aws_sdk_cpp ut_helper gtest_main aws-cpp-sdk-core ${VLD})
29 | target_compile_definitions(ut_aws_sdk_cpp PUBLIC _UNICODE UNICODE)
30 |
--------------------------------------------------------------------------------
/src/UnitTests/UTAwsSdkCpp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/UnitTests/UTAwsSdkCpp/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/UnitTests/UTAwsSdkCpp/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/UnitTests/UTAwsSdkCpp/test_aws_sdk_cpp.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | // clang-format off
18 | #include "pch.h"
19 | #ifdef __APPLE__
20 | #pragma clang diagnostic push
21 | #pragma clang diagnostic ignored "-Wunused-parameter"
22 | #endif // __APPLE__
23 | #include
24 | #include
25 | #include
26 | #include
27 | #ifdef __APPLE__
28 | #pragma clang diagnostic pop
29 | #endif // __APPLE__
30 | #include "unit_test_helper.h"
31 |
32 | using namespace Aws::Auth;
33 | using namespace Aws::Client;
34 | using namespace Aws::Http;
35 |
36 | static const char service_name[] = "es";
37 | static const char allocation_tag[] = "AWS_SIGV4_Test";
38 | static const char host[] = "https://search-bit-quill-cx3hpfoxvasohujxkllmgjwqde.us-west-2.es.amazonaws.com";
39 | static const char region[] = "us-west-2";
40 |
41 | TEST(AWS_SIGV4, EnvironmentAWSCredentials) {
42 | Aws::SDKOptions options;
43 | EXPECT_NO_THROW(Aws::InitAPI(options));
44 |
45 | auto request = CreateHttpRequest(Aws::String(host), HttpMethod::HTTP_GET, Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
46 |
47 | std::shared_ptr credential_provider = Aws::MakeShared(allocation_tag);
48 |
49 | AWSAuthV4Signer signer(credential_provider, service_name, region);
50 | ASSERT_TRUE(signer.SignRequest(*request));
51 |
52 | auto http_client = CreateHttpClient(Aws::Client::ClientConfiguration());
53 |
54 | auto response = http_client->MakeRequest(request);
55 | ASSERT_NE(response, nullptr);
56 | EXPECT_EQ(Aws::Http::HttpResponseCode::OK, response->GetResponseCode());
57 |
58 | EXPECT_NO_THROW(Aws::ShutdownAPI(options));
59 | }
60 |
61 | TEST(SettingSDKOptions, TurnLoggingOn) {
62 | Aws::SDKOptions options;
63 | options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
64 | EXPECT_NO_THROW(Aws::InitAPI(options));
65 | EXPECT_NO_THROW(Aws::ShutdownAPI(options));
66 | }
67 |
68 | int main(int argc, char** argv) {
69 | testing::internal::CaptureStdout();
70 | ::testing::InitGoogleTest(&argc, argv);
71 | int failures = RUN_ALL_TESTS();
72 | std::string output = testing::internal::GetCapturedStdout();
73 | std::cout << output << std::endl;
74 | std::cout << (failures ? "Not all tests passed." : "All tests passed") << std::endl;
75 | WriteFileIfSpecified(argv, argv + argc, "-fout", output);
76 | return failures;
77 | }
78 |
--------------------------------------------------------------------------------
/src/UnitTests/UTConn/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(ut_conn)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_conn.cpp test_query_execution.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${ODFEODBC_SRC}
22 | ${RAPIDJSON_SRC}
23 | ${RABBIT_SRC}
24 | ${LIBCURL_SRC}
25 | ${VLD_SRC} )
26 |
27 | # Generate executable
28 | add_executable(ut_conn ${SOURCE_FILES})
29 |
30 | # Library dependencies
31 | target_link_libraries(ut_conn odfesqlodbc ut_helper gtest_main)
32 | target_compile_definitions(ut_conn PUBLIC _UNICODE UNICODE)
33 |
--------------------------------------------------------------------------------
/src/UnitTests/UTConn/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/UnitTests/UTConn/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/UnitTests/UTConn/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/UnitTests/UTCriticalSection/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(ut_critical_section)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_critical_section.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${ODFEODBC_SRC}
22 | ${RAPIDJSON_SRC}
23 | ${VLD_SRC}
24 | ${RABBIT_SRC} )
25 |
26 | # Generate executable
27 | add_executable(ut_critical_section ${SOURCE_FILES})
28 |
29 | # Library dependencies
30 | target_link_libraries(ut_critical_section odfesqlodbc ut_helper gtest_main)
31 | target_compile_definitions(ut_critical_section PUBLIC _UNICODE UNICODE)
32 |
--------------------------------------------------------------------------------
/src/UnitTests/UTCriticalSection/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/UnitTests/UTCriticalSection/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/UnitTests/UTCriticalSection/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/UnitTests/UTHelper/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(ut_helper)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES unit_test_helper.cpp)
20 | set(HEADER_FILES unit_test_helper.h)
21 | include_directories(${ODFEODBC_SRC} ${VLD_SRC})
22 |
23 | # Generate dll (SHARED)
24 | add_library(ut_helper SHARED ${SOURCE_FILES} ${HEADER_FILES})
25 |
26 | if (WIN32 AND BITNESS EQUAL 64)
27 | find_library( VLD
28 | vld
29 | HINTS "${LIBRARY_DIRECTORY}/VisualLeakDetector/lib64"
30 | )
31 | target_link_libraries(ut_helper ${VLD})
32 | elseif (WIN32 AND BITNESS EQUAL 32)
33 | find_library( VLD
34 | vld
35 | HINTS "${LIBRARY_DIRECTORY}/VisualLeakDetector/lib"
36 | )
37 | target_link_libraries(ut_helper ${VLD})
38 | endif()
39 |
40 | # Library dependencies
41 | target_link_libraries(ut_helper odfesqlodbc gtest_main)
42 | target_compile_definitions(ut_helper PUBLIC _UNICODE UNICODE)
--------------------------------------------------------------------------------
/src/UnitTests/UTHelper/unit_test_helper.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #include "unit_test_helper.h"
18 |
19 | #include
20 | #include
21 |
22 | void WriteFileIfSpecified(char** begin, char** end, const std::string& option,
23 | std::string& output) {
24 | char** itr = std::find(begin, end, option);
25 | if (itr != end && ++itr != end) {
26 | std::ofstream out_file(*itr);
27 | if (out_file.good())
28 | out_file << output;
29 | }
30 | return;
31 | }
32 |
--------------------------------------------------------------------------------
/src/UnitTests/UTHelper/unit_test_helper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef UNIT_TEST_HELPER
18 | #define UNIT_TEST_HELPER
19 |
20 | #if defined(WIN32) || defined (WIN64)
21 | #ifdef _DEBUG
22 | #define VLD_FORCE_ENABLE 1
23 | #include
24 | #endif
25 | #endif
26 |
27 | #include
28 | #ifdef USE_SSL
29 | const bool use_ssl = true;
30 | #else
31 | const bool use_ssl = false;
32 | #endif
33 |
34 | void WriteFileIfSpecified(char** begin, char** end, const std::string& option,
35 | std::string& output);
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/src/UnitTests/UTRabbit/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(ut_rabbit)
17 |
18 | # Source, headers, and include dirs
19 | set(SOURCE_FILES test_rabbit.cpp)
20 | include_directories( ${UT_HELPER}
21 | ${RAPIDJSON_SRC}
22 | ${RABBIT_SRC}
23 | ${VLD_SRC} )
24 |
25 | # Generate executable
26 | add_executable(ut_rabbit ${SOURCE_FILES})
27 |
28 | target_link_libraries(ut_rabbit ut_helper gtest_main ${VLD})
29 | target_compile_definitions(ut_rabbit PUBLIC _UNICODE UNICODE)
30 |
--------------------------------------------------------------------------------
/src/UnitTests/UTRabbit/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/UnitTests/UTRabbit/pch.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.cpp
18 | // Include the standard header and generate the precompiled header.
19 | //
20 |
21 | #include "pch.h"
22 |
--------------------------------------------------------------------------------
/src/UnitTests/UTRabbit/pch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | */
15 |
16 | //
17 | // pch.h
18 | // Header for standard system include files.
19 | //
20 |
21 | #pragma once
22 |
23 | #include "gtest/gtest.h"
24 |
--------------------------------------------------------------------------------
/src/autoconf.h.in:
--------------------------------------------------------------------------------
1 | #cmakedefine AUTOCONF_ENABLE
2 | #cmakedefine AUTOCONF_STRING "@AUTOCONF_STRING@"
3 |
--------------------------------------------------------------------------------
/src/gtest/googletest-download.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | # code copied from https://crascit.com/2015/07/25/cmake-gtest/
17 | cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
18 |
19 | project(googletest-download NONE)
20 |
21 | include(ExternalProject)
22 |
23 | ExternalProject_Add(
24 | googletest
25 | SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src"
26 | BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build"
27 | GIT_REPOSITORY
28 | https://github.com/google/googletest.git
29 | GIT_TAG
30 | release-1.10.0
31 | CONFIGURE_COMMAND ""
32 | BUILD_COMMAND ""
33 | INSTALL_COMMAND ""
34 | TEST_COMMAND ""
35 | )
--------------------------------------------------------------------------------
/src/gtest/googletest.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 |
17 | # the following code to fetch googletest
18 | # is inspired by and adapted after https://crascit.com/2015/07/25/cmake-gtest/
19 | # download and unpack googletest at configure time
20 |
21 | macro(fetch_googletest _download_module_path _download_root)
22 | set(GOOGLETEST_DOWNLOAD_ROOT ${_download_root})
23 | configure_file(
24 | ${_download_module_path}/googletest-download.cmake
25 | ${_download_root}/CMakeLists.txt
26 | @ONLY
27 | )
28 | unset(GOOGLETEST_DOWNLOAD_ROOT)
29 |
30 | execute_process(
31 | COMMAND
32 | "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
33 | WORKING_DIRECTORY
34 | ${_download_root}
35 | )
36 | execute_process(
37 | COMMAND
38 | "${CMAKE_COMMAND}" --build .
39 | WORKING_DIRECTORY
40 | ${_download_root}
41 | )
42 |
43 | # adds the targers: gtest, gtest_main, gmock, gmock_main
44 | add_subdirectory(
45 | ${_download_root}/googletest-src
46 | ${_download_root}/googletest-build
47 | )
48 | endmacro()
--------------------------------------------------------------------------------
/src/installer/Resources/README.txt:
--------------------------------------------------------------------------------
1 | All files are available in '/usr/local/lib/odfe-sql-odbc' after installation.
2 |
3 | To setup a connection, you can use DSN to store your data source connection information,
4 | 1. Open 'iODBC Data Source Administrator'.
5 | 2. Go to 'User DSN'.
6 | 3. Select 'ODFE SQL ODBC DSN' and click on 'Configure'.
7 | 4. Update the connection string values. For the list of all supported options, check '/usr/local/lib/odfe-sql-odbc/doc/README.md'.
8 | 5. Click 'Ok' to save changes.
9 |
10 | If using with ODBC compatible BI tools, refer to the tool documentation on configuring a new ODBC driver. The typical requirement is to make the tool aware of the location of the driver library file and then use it to setup database (i.e Elasticsearch) connections.
11 |
12 | For example, if you want to use Tableau with Elasticsearch Server,
13 | 1. Open 'Tableau'.
14 | 2. Click on 'Other Databases (ODBC)'.
15 | 3. Select 'ODFE SQL ODBC DSN' from the DSN list or 'ODFE SQL ODBC Driver' from the driver list. If using driver, you need to enter connection string values.
16 | 4. Click on 'Connect'. All connection attributes will be retrived.
17 | 5. Click on 'Sign In'. You will be successfully connected to elasticsearch server.
18 |
19 | For more details, check 'https://github.com/opendistro-for-elasticsearch/sql-odbc'.
--------------------------------------------------------------------------------
/src/installer/Resources/Welcome.txt:
--------------------------------------------------------------------------------
1 | Open Distro for Elasticsearch SQL ODBC is a read-only ODBC driver for connecting to Open Distro for Elasticsearch SQL support.
--------------------------------------------------------------------------------
/src/installer/Resources/background.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/installer/Resources/background.bmp
--------------------------------------------------------------------------------
/src/installer/Resources/background_darkaqua.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/installer/Resources/background_darkaqua.bmp
--------------------------------------------------------------------------------
/src/installer/Resources/odfe_sql_odbc.tdc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/installer/banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/installer/banner.bmp
--------------------------------------------------------------------------------
/src/installer/dialog.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/installer/dialog.bmp
--------------------------------------------------------------------------------
/src/installer/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/sql-odbc/2244401281047f4eeddd7e3ae021db670be048fb/src/installer/icon.ico
--------------------------------------------------------------------------------
/src/installer/patch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/installer/postinstall:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PKG_INSTALL_DIR=/Applications
4 | FINAL_INSTALL_DIR=/usr/local/lib/odfe-sql-odbc
5 |
6 | # Remove install directory if it already exists
7 | if [ -d "${FINAL_INSTALL_DIR}" ]; then
8 | # Fail if FINAL_INSTALL_DIR is not set for whatever reason
9 | if [ -z ${FINAL_INSTALL_DIR} ]; then exit 1; fi
10 | rm -rf ${FINAL_INSTALL_DIR}
11 | fi
12 |
13 | # Move PKG installed folders to intended install directory
14 | mkdir -p ${FINAL_INSTALL_DIR}
15 | mv ${PKG_INSTALL_DIR}/bin ${FINAL_INSTALL_DIR}/bin
16 | mv ${PKG_INSTALL_DIR}/doc ${FINAL_INSTALL_DIR}/doc
17 | mv ${PKG_INSTALL_DIR}/resources ${FINAL_INSTALL_DIR}/resources
18 |
19 | # TODO: look into why DSN installer is not working for fresh Mac install
20 | # Current issue: "General installer error" when adding driver entry
21 |
22 | # Run DSN installer to configurate driver and DSN for system for easy setup.
23 | # chmod a+x ${FINAL_INSTALL_DIR}/bin/dsn_installer
24 | # chmod a+x ${FINAL_INSTALL_DIR}/bin/remove-odfe-dsn.sh
25 | # echo "I can write to this file" > /tmp/dsn_installer.log
26 | # ${FINAL_INSTALL_DIR}/bin/dsn_installer ${FINAL_INSTALL_DIR}/bin/ >> /tmp/dsn_installer.log
27 | # echo "After DSN Installer finishes" >> /tmp/dsn_installer.log
28 |
--------------------------------------------------------------------------------
/src/installer/remove-odfe-dsn.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "This script will only remove the default DSN and Driver entries from your ODBC configuration."
4 | echo "You will be responsible for removing installed files from the system."
5 | if [[ $EUID -ne 0 ]]; then
6 | echo "ERROR: This script must be run as root"
7 | exit 1
8 | fi
9 |
10 | # check for "Yes"
11 | while true; do
12 | read -p "Do you want to continue? (Y/y) " yn
13 | case $yn in
14 | [Yy]* ) break;;
15 | [Nn]* ) exit;;
16 | * ) echo "Please answer yes or no.";;
17 | esac
18 | done
19 |
20 | # Run dsn_installer uninstall
21 | ${BASH_SOURCE%/*}/dsn_installer uninstall
22 | if [ $? -ne 0 ]; then
23 | echo "Error while removing DSN and Driver entries."
24 | else
25 | echo "DSN and Driver entries have been removed successfully."
26 | fi
27 |
--------------------------------------------------------------------------------
/src/odfeenlist/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(odfeenlist)
17 |
18 | # Source files for odfeenlist
19 | set(SOURCE_FILES msdtc_enlist.cpp)
20 | set(HEADER_FILES elasticenlist.h)
21 |
22 | # Generate static lib
23 | add_library(odfeenlist STATIC ${SOURCE_FILES} ${HEADER_FILES})
24 |
25 | # Library dependencies
26 | target_link_libraries(odfeenlist kernel32 advapi32 Delayimp XOleHlp)
27 |
28 | # Platform specific library dependencies
29 | if(WIN32)
30 | # Windows specifiec
31 | target_link_libraries(odfeenlist wsock32 winspool user32 gdi32 comdlg32 shell32 uuid)
32 | else()
33 | # Unix specific
34 | endif()
--------------------------------------------------------------------------------
/src/odfeenlist/elasticenlist.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __ESENLIST_H__
18 | #define __ESENLIST_H__
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 | #ifdef WIN32
24 | #ifdef _HANDLE_ENLIST_IN_DTC_
25 |
26 | #undef DLL_DECLARE
27 | #ifdef _ESENLIST_FUNCS_IMPLEMENT_
28 | #define DLL_DECLARE _declspec(dllexport)
29 | #else
30 | #ifdef _ESENLIST_FUNCS_IMPORT_
31 | #define DLL_DECLARE _declspec(dllimport)
32 | #else
33 | #define DLL_DECLARE
34 | #endif /* _ESENLIST_FUNCS_IMPORT_ */
35 | #endif /* _ESENLIST_FUNCS_IMPLEMENT_ */
36 |
37 | RETCODE EnlistInDtc(void *conn, void *pTra, int method);
38 | RETCODE DtcOnDisconnect(void *);
39 | RETCODE IsolateDtcConn(void *, BOOL continueConnection);
40 | // for testing
41 | DLL_DECLARE void *GetTransactionObject(HRESULT *hres);
42 | DLL_DECLARE void ReleaseTransactionObject(void *);
43 |
44 | #endif /* _HANDLE_ENLIST_IN_DTC_ */
45 | #endif /* WIN32 */
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif
50 | #endif /* __ESENLIST_H__ */
51 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License").
5 | # You may not use this file except in compliance with the License.
6 | # A copy of the License is located at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # or in the "license" file accompanying this file. This file is distributed
11 | # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | # express or implied. See the License for the specific language governing
13 | # permissions and limitations under the License.
14 | #
15 |
16 | project(odfesqlodbc)
17 |
18 | # Source files for odfesqlodbc
19 | set( SOURCE_FILES
20 | bind.c columninfo.c connection.c convert.c
21 | descriptor.c dlg_specific.c drvconn.c options.c
22 | environ.c execute.c info.c loadlib.c
23 | misc.c multibyte.c mylog.c tuple.c
24 | parse.c results.c statement.c odbcapi30.c
25 | qresult.c odbcapi30w.c es_api30.c es_types.c
26 | es_utility.cpp es_communication.cpp es_connection.cpp es_odbc.c
27 | es_driver_connect.cpp es_helper.cpp es_info.cpp es_parse_result.cpp
28 | es_semaphore.cpp es_statement.cpp win_unicode.c odbcapi.c
29 | odbcapiw.c es_result_queue.cpp
30 | )
31 | if(WIN32)
32 | set(SOURCE_FILES ${SOURCE_FILES} dlg_wingui.c setup.c)
33 | endif()
34 |
35 | set( HEADER_FILES
36 | bind.h catfunc.h columninfo.h
37 | convert.h descriptor.h dlg_specific.h drvconn.h
38 | environ.h es_apifunc.h es_communication.h es_parse_result.h
39 | es_connection.h es_driver_connect.h es_helper.h es_info.h
40 | es_statement.h es_types.h loadlib.h
41 | misc.h multibyte.h mylog.h es_utility.h
42 | resource.h statement.h tuple.h unicode_support.h
43 | es_apifunc.h es_odbc.h es_semaphore.h qresult.h
44 | version.h win_setup.h es_result_queue.h
45 | )
46 |
47 | # Generate dll (SHARED)
48 | if(WIN32)
49 | set(RESOURCE_FILES es_odbc.rc)
50 | add_library(odfesqlodbc SHARED ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${AWSSDK_LIB_DIR})
51 | else()
52 | add_library(odfesqlodbc SHARED ${SOURCE_FILES} ${HEADER_FILES})
53 | endif()
54 |
55 | include_directories(
56 | ${LIBRARY_DIRECTORY}/../src
57 | ${CMAKE_CURRENT_SOURCE_DIR}
58 | ${ODFEENLIST_SRC}
59 | ${RABBIT_SRC}
60 | ${RAPIDJSON_SRC}
61 | ${AWSSDK_INCLUDE_DIR}
62 | )
63 |
64 | # Platform specific library dependencies
65 | if(WIN32)
66 | # Windows specifiec
67 | target_link_libraries(odfesqlodbc wsock32 ws2_32 winmm user32 gdi32 legacy_stdio_definitions aws-cpp-sdk-core kernel32 advapi32 secur32 XOleHlp Wldap32 crypt32 Normaliz odbccp32 odbc32)
68 | target_link_libraries(odfesqlodbc debug msvcrtd)
69 | target_link_libraries(odfesqlodbc optimized msvcrt)
70 | elseif(APPLE)
71 | # Apple specific
72 | target_link_libraries(odfesqlodbc iodbc iodbcinst aws-cpp-sdk-core)
73 | elseif(UNIX)
74 | # Unix specific
75 | include_directories(/usr/src/linux-headers-5.0.0-27/include)
76 | target_link_libraries(odfesqlodbc aws-cpp-sdk-core odbc odbcinst)
77 | endif()
78 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/columninfo.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #include "columninfo.h"
18 | #include "es_types.h"
19 |
20 | #include
21 | #include
22 | #include "es_apifunc.h"
23 | #include "es_connection.h"
24 |
25 | ColumnInfoClass *CI_Constructor(void) {
26 | ColumnInfoClass *rv;
27 |
28 | rv = (ColumnInfoClass *)malloc(sizeof(ColumnInfoClass));
29 |
30 | if (rv) {
31 | rv->refcount = 0;
32 | rv->num_fields = 0;
33 | rv->coli_array = NULL;
34 | }
35 |
36 | return rv;
37 | }
38 |
39 | void CI_Destructor(ColumnInfoClass *self) {
40 | CI_free_memory(self);
41 |
42 | free(self);
43 | }
44 |
45 | void CI_free_memory(ColumnInfoClass *self) {
46 | register Int2 lf;
47 | int num_fields = self->num_fields;
48 |
49 | /* Safe to call even if null */
50 | self->num_fields = 0;
51 | if (self->coli_array) {
52 | for (lf = 0; lf < num_fields; lf++) {
53 | if (self->coli_array[lf].name) {
54 | free(self->coli_array[lf].name);
55 | self->coli_array[lf].name = NULL;
56 | }
57 | }
58 | free(self->coli_array);
59 | self->coli_array = NULL;
60 | }
61 | }
62 |
63 | void CI_set_num_fields(ColumnInfoClass *self, SQLSMALLINT new_num_fields) {
64 | CI_free_memory(self); /* always safe to call */
65 |
66 | self->num_fields = new_num_fields;
67 |
68 | self->coli_array =
69 | (struct srvr_info *)calloc(sizeof(struct srvr_info), self->num_fields);
70 | }
71 |
72 | void CI_set_field_info(ColumnInfoClass *self, int field_num,
73 | const char *new_name, OID new_adtid, Int2 new_adtsize,
74 | Int4 new_atttypmod, OID new_relid, OID new_attid) {
75 | /* check bounds */
76 | if ((field_num < 0) || (field_num >= self->num_fields))
77 | return;
78 |
79 | /* store the info */
80 | self->coli_array[field_num].name = strdup(new_name);
81 | self->coli_array[field_num].adtid = new_adtid;
82 | self->coli_array[field_num].adtsize = new_adtsize;
83 | self->coli_array[field_num].atttypmod = new_atttypmod;
84 |
85 | self->coli_array[field_num].display_size = ES_ADT_UNSET;
86 | self->coli_array[field_num].relid = new_relid;
87 | self->coli_array[field_num].attid = (short)new_attid;
88 | }
89 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/columninfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __COLUMNINFO_H__
18 | #define __COLUMNINFO_H__
19 |
20 | #include "es_odbc.h"
21 |
22 | struct ColumnInfoClass_ {
23 | UInt4 refcount; /* reference count. A ColumnInfo can be shared by
24 | * several qresults. */
25 | Int2 num_fields;
26 | struct srvr_info {
27 | char *name; /* field name */
28 | OID adtid; /* type oid */
29 | Int2 adtsize; /* type size */
30 | Int4 display_size; /* the display size (longest row) */
31 | Int4 atttypmod; /* the length of bpchar/varchar */
32 | OID relid; /* the relation id */
33 | Int2 attid; /* the attribute number */
34 | } * coli_array;
35 | };
36 |
37 | #define CI_get_num_fields(self) (self->num_fields)
38 | #define CI_get_oid(self, col) (self->coli_array[col].adtid)
39 | #define CI_get_fieldname(self, col) (self->coli_array[col].name)
40 | #define CI_get_fieldsize(self, col) (self->coli_array[col].adtsize)
41 | #define CI_get_display_size(self, col) (self->coli_array[col].display_size)
42 | #define CI_get_atttypmod(self, col) (self->coli_array[col].atttypmod)
43 | #define CI_get_relid(self, col) (self->coli_array[col].relid)
44 | #define CI_get_attid(self, col) (self->coli_array[col].attid)
45 |
46 | ColumnInfoClass *CI_Constructor(void);
47 | void CI_Destructor(ColumnInfoClass *self);
48 | void CI_free_memory(ColumnInfoClass *self);
49 |
50 | /* functions for setting up the fields from within the program, */
51 | /* without reading from a socket */
52 | void CI_set_num_fields(ColumnInfoClass *self, SQLSMALLINT new_num_fields);
53 |
54 | // Used in es_parse_results.cpp
55 | #ifdef __cplusplus
56 | extern "C" {
57 | #endif
58 | void CI_set_field_info(ColumnInfoClass *self, int field_num,
59 | const char *new_name, OID new_adtid, Int2 new_adtsize,
60 | Int4 atttypmod, OID new_relid, OID new_attid);
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/convert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __CONVERT_H__
18 | #define __CONVERT_H__
19 |
20 | #include "es_odbc.h"
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 | /* copy_and_convert results */
26 | #define COPY_OK 0
27 | #define COPY_UNSUPPORTED_TYPE 1
28 | #define COPY_UNSUPPORTED_CONVERSION 2
29 | #define COPY_RESULT_TRUNCATED 3
30 | #define COPY_GENERAL_ERROR 4
31 | #define COPY_NO_DATA_FOUND 5
32 | #define COPY_INVALID_STRING_CONVERSION 6
33 |
34 | int copy_and_convert_field_bindinfo(StatementClass *stmt, OID field_type,
35 | int atttypmod, void *value, int col);
36 | int copy_and_convert_field(StatementClass *stmt, OID field_type, int atttypmod,
37 | void *value, SQLSMALLINT fCType, int precision,
38 | PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue,
39 | SQLLEN *pIndicator);
40 |
41 | SQLLEN es_hex2bin(const char *in, char *out, SQLLEN len);
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 | #endif
47 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/drvconn.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef _DRVCONN_H_
18 | #define _DRVCONN_H_
19 |
20 | #include
21 | #include
22 |
23 | #include "es_connection.h"
24 | #include "es_odbc.h"
25 | #include "misc.h"
26 |
27 | #ifndef WIN32
28 | #include
29 | #include
30 | #else
31 | #include
32 | #endif
33 |
34 | #include
35 |
36 | #ifdef WIN32
37 | #include
38 |
39 | #include "resource.h"
40 | #endif
41 | #include "dlg_specific.h"
42 | #include "es_apifunc.h"
43 |
44 | #define PASSWORD_IS_REQUIRED 1
45 |
46 | #ifdef __cplusplus
47 | extern "C" {
48 | #endif
49 | char *hide_password(const char *str);
50 | BOOL dconn_get_connect_attributes(const char *connect_string, ConnInfo *ci);
51 | BOOL dconn_get_DSN_or_Driver(const char *connect_string, ConnInfo *ci);
52 | int paramRequired(const ConnInfo *ci, int reqs);
53 | #ifdef WIN32
54 | RETCODE dconn_DoDialog(HWND hwnd, ConnInfo *ci);
55 | #endif
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/environ.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __ENVIRON_H__
18 | #define __ENVIRON_H__
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | #include "es_helper.h"
25 | #include "es_odbc.h"
26 |
27 | #define ENV_ALLOC_ERROR 1
28 |
29 | /********** Environment Handle *************/
30 | struct EnvironmentClass_ {
31 | char *errormsg;
32 | int errornumber;
33 | Int4 flag;
34 | void *cs;
35 | };
36 |
37 | /* Environment prototypes */
38 | EnvironmentClass *EN_Constructor(void);
39 | char EN_Destructor(EnvironmentClass *self);
40 | char EN_get_error(EnvironmentClass *self, int *number, char **message);
41 | char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn);
42 | char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn);
43 | void EN_log_error(const char *func, char *desc, EnvironmentClass *self);
44 |
45 | #define EN_OV_ODBC2 1L
46 | #define EN_CONN_POOLING (1L << 1)
47 | #define EN_is_odbc2(env) ((env->flag & EN_OV_ODBC2) != 0)
48 | #define EN_is_odbc3(env) (env && (env->flag & EN_OV_ODBC2) == 0)
49 | #define EN_set_odbc2(env) (env->flag |= EN_OV_ODBC2)
50 | #define EN_set_odbc3(env) (env->flag &= ~EN_OV_ODBC2)
51 | #define EN_is_pooling(env) (env && (env->flag & EN_CONN_POOLING) != 0)
52 | #define EN_set_pooling(env) (env->flag |= EN_CONN_POOLING)
53 | #define EN_unset_pooling(env) (env->flag &= ~EN_CONN_POOLING)
54 |
55 | /* For Multi-thread */
56 | #define INIT_CONNS_CS XPlatformInitializeCriticalSection(&conns_cs)
57 | #define ENTER_CONNS_CS XPlatformEnterCriticalSection(conns_cs)
58 | #define LEAVE_CONNS_CS XPlatformLeaveCriticalSection(conns_cs)
59 | #define DELETE_CONNS_CS XPlatformDeleteCriticalSection(&conns_cs)
60 | #define INIT_ENV_CS(x) XPlatformInitializeCriticalSection(&((x)->cs))
61 | #define ENTER_ENV_CS(x) XPlatformEnterCriticalSection(((x)->cs))
62 | #define LEAVE_ENV_CS(x) XPlatformLeaveCriticalSection(((x)->cs))
63 | #define DELETE_ENV_CS(x) XPlatformDeleteCriticalSection(&((x)->cs))
64 | #define INIT_COMMON_CS XPlatformInitializeCriticalSection(&common_cs)
65 | #define ENTER_COMMON_CS XPlatformEnterCriticalSection(common_cs)
66 | #define LEAVE_COMMON_CS XPlatformLeaveCriticalSection(common_cs)
67 | #define DELETE_COMMON_CS XPlatformDeleteCriticalSection(&common_cs)
68 |
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 | #endif /* __ENVIRON_H_ */
73 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_driver_connect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __ES_DRIVER_CONNECT_H__
18 | #define __ES_DRIVER_CONNECT_H__
19 | #include "es_connection.h"
20 |
21 | // C Interface
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 | RETCODE ESAPI_DriverConnect(HDBC hdbc, HWND hwnd, SQLCHAR *conn_str_in,
26 | SQLSMALLINT conn_str_in_len, SQLCHAR *conn_str_out,
27 | SQLSMALLINT conn_str_out_len,
28 | SQLSMALLINT *pcb_conn_str_out,
29 | SQLUSMALLINT driver_completion);
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 |
34 | #endif /* __ES_DRIVER_CONNECT_H__ */
35 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_helper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __ES_HELPER_H__
18 | #define __ES_HELPER_H__
19 |
20 | #include "es_types.h"
21 |
22 | #ifdef __cplusplus
23 | // C++ interface
24 | std::string ESGetClientEncoding(void* es_conn);
25 | bool ESSetClientEncoding(void* es_conn, std::string& encoding);
26 | ESResult* ESGetResult(void* es_conn);
27 | void ESClearResult(ESResult* es_result);
28 | void* ESConnectDBParams(runtime_options& rt_opts, int expand_dbname,
29 | unsigned int option_count);
30 | std::string GetServerVersion(void* es_conn);
31 | std::string GetClusterName(void* es_conn);
32 | std::string GetErrorMsg(void* es_conn);
33 |
34 | // C Interface
35 | extern "C" {
36 | #endif
37 | void XPlatformInitializeCriticalSection(void** critical_section_helper);
38 | void XPlatformEnterCriticalSection(void* critical_section_helper);
39 | void XPlatformLeaveCriticalSection(void* critical_section_helper);
40 | void XPlatformDeleteCriticalSection(void** critical_section_helper);
41 | ConnStatusType ESStatus(void* es_conn);
42 | int ESExecDirect(void* es_conn, const char* statement, const char* fetch_size);
43 | void ESSendCursorQueries(void* es_conn, const char* cursor);
44 | void ESDisconnect(void* es_conn);
45 | void ESStopRetrieval(void* es_conn);
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | void* InitializeESConn();
51 |
52 | #endif // __ES_HELPER_H__
53 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __ES_INFO_H__
18 | #define __ES_INFO_H__
19 | #include "es_helper.h"
20 | #include "es_odbc.h"
21 | #include "unicode_support.h"
22 |
23 | #ifndef WIN32
24 | #include
25 | #endif
26 |
27 | #include "bind.h"
28 | #include "catfunc.h"
29 | #include "dlg_specific.h"
30 | #include "environ.h"
31 | #include "es_apifunc.h"
32 | #include "es_connection.h"
33 | #include "es_types.h"
34 | #include "misc.h"
35 | #include "multibyte.h"
36 | #include "qresult.h"
37 | #include "statement.h"
38 | #include "tuple.h"
39 |
40 | // C Interface
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 | RETCODE SQL_API ESAPI_Tables(HSTMT hstmt, const SQLCHAR* catalog_name_sql,
45 | const SQLSMALLINT catalog_name_sz,
46 | const SQLCHAR* schema_name_sql,
47 | const SQLSMALLINT schema_name_sz,
48 | const SQLCHAR* table_name_sql,
49 | const SQLSMALLINT table_name_sz,
50 | const SQLCHAR* table_type_sql,
51 | const SQLSMALLINT table_type_sz, const UWORD flag);
52 | RETCODE SQL_API
53 | ESAPI_Columns(HSTMT hstmt, const SQLCHAR* catalog_name_sql,
54 | const SQLSMALLINT catalog_name_sz, const SQLCHAR* schema_name_sql,
55 | const SQLSMALLINT schema_name_sz, const SQLCHAR* table_name_sql,
56 | const SQLSMALLINT table_name_sz, const SQLCHAR* column_name_sql,
57 | const SQLSMALLINT column_name_sz, const UWORD flag,
58 | const OID reloid, const Int2 attnum);
59 |
60 | RETCODE SQL_API ESAPI_GetTypeInfo(HSTMT hstmt, SQLSMALLINT fSqlType);
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 |
65 | #endif /* __ES_INFO_H__ */
66 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_parse_result.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef _ES_PARSE_RESULT_H_
18 | #define _ES_PARSE_RESULT_H_
19 | #include "qresult.h"
20 |
21 | #ifdef __cplusplus
22 | std::string GetResultParserError();
23 | extern "C" {
24 | #endif
25 | #ifdef __cplusplus
26 | }
27 | #endif
28 |
29 | #ifdef __cplusplus
30 | #include "es_helper.h"
31 | typedef rabbit::document json_doc;
32 | // const char* is used instead of string for the cursor, because a NULL cursor
33 | // is sometimes used Cannot pass q_res as reference because it breaks qresult.h
34 | // macros that expect to use -> operator
35 | BOOL CC_from_ESResult(QResultClass *q_res, ConnectionClass *conn,
36 | const char *cursor, ESResult &es_result);
37 | BOOL CC_Metadata_from_ESResult(QResultClass *q_res, ConnectionClass *conn,
38 | const char *cursor, ESResult &es_result);
39 | BOOL CC_No_Metadata_from_ESResult(QResultClass *q_res, ConnectionClass *conn,
40 | const char *cursor, ESResult &es_result);
41 | BOOL CC_Append_Table_Data(json_doc &es_result_doc, QResultClass *q_res,
42 | size_t doc_schema_size, ColumnInfoClass &fields);
43 | #endif
44 | #endif
45 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_result_queue.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #include "es_result_queue.h"
18 |
19 | #include "es_types.h"
20 |
21 | ESResultQueue::ESResultQueue(unsigned int capacity)
22 | : m_push_semaphore(capacity, capacity),
23 | m_pop_semaphore(0, capacity) {
24 | }
25 |
26 | ESResultQueue::~ESResultQueue() {
27 | while (!m_queue.empty()) {
28 | delete m_queue.front();
29 | m_queue.pop();
30 | }
31 | }
32 |
33 | void ESResultQueue::clear() {
34 | std::scoped_lock lock(m_queue_mutex);
35 | while (!m_queue.empty()) {
36 | delete m_queue.front();
37 | m_queue.pop();
38 | m_push_semaphore.release();
39 | m_pop_semaphore.lock();
40 | }
41 | }
42 |
43 | bool ESResultQueue::pop(unsigned int timeout_ms, ESResult*& result) {
44 | if (m_pop_semaphore.try_lock_for(timeout_ms)) {
45 | std::scoped_lock lock(m_queue_mutex);
46 | result = m_queue.front();
47 | m_queue.pop();
48 | m_push_semaphore.release();
49 | return true;
50 | }
51 |
52 | return false;
53 | }
54 |
55 | bool ESResultQueue::push(unsigned int timeout_ms, ESResult* result) {
56 | if (m_push_semaphore.try_lock_for(timeout_ms)) {
57 | std::scoped_lock lock(m_queue_mutex);
58 | m_queue.push(result);
59 | m_pop_semaphore.release();
60 | return true;
61 | }
62 |
63 | return false;
64 | }
65 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_result_queue.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 | #ifndef ES_RESULT_QUEUE
17 | #define ES_RESULT_QUEUE
18 |
19 | #include
20 | #include
21 | #include "es_semaphore.h"
22 |
23 | #define QUEUE_TIMEOUT 20 // milliseconds
24 |
25 | struct ESResult;
26 |
27 | class ESResultQueue {
28 | public:
29 | ESResultQueue(unsigned int capacity);
30 | ~ESResultQueue();
31 |
32 | void clear();
33 | bool pop(unsigned int timeout_ms, ESResult*& result);
34 | bool push(unsigned int timeout_ms, ESResult* result);
35 |
36 | private:
37 | std::queue m_queue;
38 | std::mutex m_queue_mutex;
39 | es_semaphore m_push_semaphore;
40 | es_semaphore m_pop_semaphore;
41 | };
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_semaphore.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #include "es_semaphore.h"
18 |
19 | #include
20 |
21 | #ifdef WIN32
22 | namespace {
23 | HANDLE createSemaphore(unsigned int initial, unsigned int capacity) {
24 | HANDLE semaphore = NULL;
25 | std::string semName;
26 | while (NULL == semaphore) {
27 | semName = "es_sem_" + std::to_string(rand() * 1000);
28 | semaphore = CreateSemaphore(NULL, initial, capacity, semName.c_str());
29 | }
30 |
31 | return semaphore;
32 | }
33 | } // namespace
34 | #else
35 | #include
36 | #endif
37 |
38 | #ifdef __APPLE__
39 | #pragma clang diagnostic push
40 | #pragma clang diagnostic ignored "-Wunused-parameter"
41 | #endif // __APPLE__
42 | es_semaphore::es_semaphore(unsigned int initial, unsigned int capacity)
43 | #ifdef __APPLE__
44 | #pragma clang diagnostic pop
45 | #endif // __APPLE__
46 | :
47 | #ifdef WIN32
48 | m_semaphore(createSemaphore(initial, capacity))
49 | #elif defined(__APPLE__)
50 | m_semaphore(dispatch_semaphore_create(initial))
51 | #endif
52 | {
53 | #if !defined(WIN32) && !defined(__APPLE__)
54 | sem_init(&m_semaphore, 0, capacity);
55 | #endif
56 | }
57 |
58 | es_semaphore::~es_semaphore() {
59 | #ifdef WIN32
60 | CloseHandle(m_semaphore);
61 | #elif defined(__APPLE__)
62 | #else
63 | sem_destroy(&m_semaphore);
64 | #endif
65 | }
66 |
67 | void es_semaphore::lock() {
68 | #ifdef WIN32
69 | WaitForSingleObject(m_semaphore, INFINITE);
70 | #elif defined(__APPLE__)
71 | dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
72 | #else
73 | sem_wait(&m_semaphore);
74 | #endif
75 | }
76 |
77 | void es_semaphore::release() {
78 | #ifdef WIN32
79 | ReleaseSemaphore(m_semaphore, 1, NULL);
80 | #elif defined(__APPLE__)
81 | dispatch_semaphore_signal(m_semaphore);
82 | #else
83 | sem_post(&m_semaphore);
84 | #endif
85 | }
86 |
87 | bool es_semaphore::try_lock_for(unsigned int timeout_ms) {
88 | #ifdef WIN32
89 | return WaitForSingleObject(m_semaphore, timeout_ms) == WAIT_OBJECT_0;
90 | #elif defined(__APPLE__)
91 | return 0
92 | == dispatch_semaphore_wait(
93 | m_semaphore, dispatch_time(DISPATCH_TIME_NOW,
94 | static_cast< int64_t >(
95 | timeout_ms * NSEC_PER_MSEC)));
96 | #else
97 | struct timespec ts;
98 | if (-1 == clock_gettime(CLOCK_REALTIME, &ts)) {
99 | return false;
100 | }
101 |
102 | ts.tv_nsec += timeout_ms * 1000000;
103 | return 0 == sem_timedwait(&m_semaphore & ts);
104 | #endif
105 | }
106 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_semaphore.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 | #ifndef ES_SEMAPHORE
17 | #define ES_SEMAPHORE
18 |
19 | #ifdef WIN32
20 | #include
21 | #elif defined(__APPLE__)
22 | #include
23 | #else
24 | #include
25 | #endif
26 |
27 | class es_semaphore {
28 | public:
29 | es_semaphore(unsigned int initial, unsigned int capacity);
30 | ~es_semaphore();
31 |
32 | void lock();
33 | void release();
34 | bool try_lock_for(unsigned int timeout_ms);
35 |
36 | private:
37 | #ifdef WIN32
38 | HANDLE m_semaphore;
39 | #elif defined(__APPLE__)
40 | dispatch_semaphore_t m_semaphore;
41 | #else
42 | sem_t m_semaphore;
43 | #endif
44 | };
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_statement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef _ES_STATEMENT_H_
18 | #define _ES_STATEMENT_H_
19 |
20 | #include "es_parse_result.h"
21 | #include "qresult.h"
22 | #include "statement.h"
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 | RETCODE RePrepareStatement(StatementClass *stmt);
28 | RETCODE PrepareStatement(StatementClass* stmt, const SQLCHAR *stmt_str, SQLINTEGER stmt_sz);
29 | RETCODE ExecuteStatement(StatementClass *stmt, BOOL commit);
30 | QResultClass *SendQueryGetResult(StatementClass *stmt, BOOL commit);
31 | RETCODE AssignResult(StatementClass *stmt);
32 | SQLRETURN ESAPI_Cancel(HSTMT hstmt);
33 | SQLRETURN GetNextResultSet(StatementClass *stmt);
34 | void ClearESResult(void *es_result);
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/es_utility.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef ES_UTILITY_H
18 | #define ES_UTILITY_H
19 |
20 | #include
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | typedef struct ESExpBufferData {
27 | char *data;
28 | size_t len;
29 | size_t maxlen;
30 | } ESExpBufferData;
31 |
32 | typedef ESExpBufferData *ESExpBuffer;
33 |
34 | #define ESExpBufferBroken(str) ((str) == NULL || (str)->maxlen == 0)
35 | #define ESExpBufferDataBroken(buf) ((buf).maxlen == 0)
36 | #define INITIAL_EXPBUFFER_SIZE 256
37 |
38 | void InitESExpBuffer(ESExpBuffer str);
39 | void AppendESExpBuffer(ESExpBuffer str, const char *fmt, ...);
40 | void TermESExpBuffer(ESExpBuffer str);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif
45 |
46 | #endif /* ES_UTILITY_H */
47 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/loadlib.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __LOADLIB_H__
18 | #define __LOADLIB_H__
19 |
20 | #include "es_odbc.h"
21 | #ifdef HAVE_LIBLTDL
22 | #include
23 | #else
24 | #ifdef HAVE_DLFCN_H
25 | #include
26 | #endif /* HAVE_DLFCN_H */
27 | #endif /* HAVE_LIBLTDL */
28 |
29 | #include
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | #ifdef _HANDLE_ENLIST_IN_DTC_
35 | RETCODE CALL_EnlistInDtc(ConnectionClass *conn, void *pTra, int method);
36 | RETCODE CALL_DtcOnDisconnect(ConnectionClass *);
37 | RETCODE CALL_IsolateDtcConn(ConnectionClass *, BOOL);
38 | void *CALL_GetTransactionObject(HRESULT *);
39 | void CALL_ReleaseTransactionObject(void *);
40 | #endif /* _HANDLE_ENLIST_IN_DTC_ */
41 | /* void UnloadDelayLoadedDLLs(BOOL); */
42 | void CleanupDelayLoadedDLLs(void);
43 | #ifdef WIN32
44 | HMODULE MODULE_load_from_elasticodbc_path(const char *module_name);
45 | void AlreadyLoadedElasticsearchodbc(void);
46 | #endif /* WIN32 */
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 | #endif /* __LOADLIB_H__ */
52 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/parse.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #include "es_odbc.h"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include "catfunc.h"
24 | #include "es_apifunc.h"
25 | #include "es_connection.h"
26 | #include "es_types.h"
27 | #include "qresult.h"
28 | #include "statement.h"
29 |
30 | #include "es_info.h"
31 | #include "misc.h"
32 | #include "multibyte.h"
33 |
34 | Int4 FI_precision(const FIELD_INFO *fi) {
35 | OID ftype;
36 |
37 | if (!fi)
38 | return -1;
39 | ftype = FI_type(fi);
40 | switch (ftype) {
41 | case ES_TYPE_NUMERIC:
42 | return fi->column_size;
43 | case ES_TYPE_DATETIME:
44 | case ES_TYPE_TIMESTAMP_NO_TMZONE:
45 | return fi->decimal_digits;
46 | }
47 | return 0;
48 | }
49 |
50 | static void setNumFields(IRDFields *irdflds, size_t numFields) {
51 | FIELD_INFO **fi = irdflds->fi;
52 | size_t nfields = irdflds->nfields;
53 |
54 | if (numFields < nfields) {
55 | int i;
56 |
57 | for (i = (int)numFields; i < (int)nfields; i++) {
58 | if (fi[i])
59 | fi[i]->flag = 0;
60 | }
61 | }
62 | irdflds->nfields = (UInt4)numFields;
63 | }
64 |
65 | void SC_initialize_cols_info(StatementClass *stmt, BOOL DCdestroy,
66 | BOOL parseReset) {
67 | IRDFields *irdflds = SC_get_IRDF(stmt);
68 |
69 | /* Free the parsed table information */
70 | if (stmt->ti) {
71 | TI_Destructor(stmt->ti, stmt->ntab);
72 | free(stmt->ti);
73 | stmt->ti = NULL;
74 | }
75 | stmt->ntab = 0;
76 | if (DCdestroy) /* Free the parsed field information */
77 | DC_Destructor((DescriptorClass *)SC_get_IRD(stmt));
78 | else
79 | setNumFields(irdflds, 0);
80 | if (parseReset) {
81 | stmt->parse_status = STMT_PARSE_NONE;
82 | SC_reset_updatable(stmt);
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by es_odbc.rc
4 | //
5 | #define IDS_BADDSN 1
6 | #define IDS_MSGTITLE 2
7 | #define IDOK2 3
8 | #define IDC_TEST 4
9 | #define IDC_PASSWORD_STATIC 4
10 | #define IDC_SSL_STATIC 4
11 | #define IDC_HOST_VER_STATIC 5
12 | #define IDC_DSNAME 400
13 | #define IDC_DSNAMETEXT 401
14 | #define IDC_DESC 404
15 | #define IDC_FETCH_SIZE_STATIC 404
16 | #define IDC_SERVER 407
17 | #define IDC_NOTICE_USER 414
18 | #define IDS_AUTHTYPE_NONE 417
19 | #define IDS_AUTHTYPE_BASIC 418
20 | #define IDS_AUTHTYPE_IAM 419
21 | #define IDS_LOGTYPE_OFF 420
22 | #define IDS_LOGTYPE_FATAL 421
23 | #define IDS_LOGTYPE_ERROR 422
24 | #define IDS_LOGTYPE_WARNING 423
25 | #define IDS_LOGTYPE_INFO 424
26 | #define IDS_LOGTYPE_DEBUG 425
27 | #define IDS_LOGTYPE_TRACE 426
28 | #define IDS_LOGTYPE_ALL 427
29 | #define DLG_CONFIG 1001
30 | #define IDC_PORT 1002
31 | #define IDC_USER 1006
32 | #define IDC_PASSWORD 1009
33 | #define IDC_MANAGEDSN 1077
34 | #define IDC_EDIT1 1112
35 | #define IDC_CONNTIMEOUT_STATIC 1112
36 | #define IDC_CHECK1 1113
37 | #define IDC_CHECK2 1114
38 | #define IDC_USESSL 1114
39 | #define IDC_COMBO1 1115
40 | #define IDC_AUTHTYPE 1115
41 | #define IDC_HOST_VER 1115
42 | #define IDC_USERNAME_STATIC 1116
43 | #define IDC_REGION 1121
44 | #define IDC_REGION_STATIC 1122
45 | #define IDC_AUTH_STATIC 1123
46 | #define ID_ADVANCED_OPTIONS 1124
47 | #define ID_LOG_OPTIONS 1125
48 | #define IDC_DRIVER_VERSION 1126
49 | #define IDC_AUTH_SETTINGS 1127
50 | #define IDC_CONN_SETTINGS 1128
51 | #define DLG_ADVANCED_OPTIONS 1129
52 | #define IDC_CONNTIMEOUT 1130
53 | #define DLG_LOG_OPTIONS 1131
54 | #define IDC_FETCH_SIZE 1131
55 | #define IDC_LOG_LEVEL 1132
56 | #define IDC_LOG_PATH 1133
57 |
58 | // Next default values for new objects
59 | //
60 | #ifdef APSTUDIO_INVOKED
61 | #ifndef APSTUDIO_READONLY_SYMBOLS
62 | #define _APS_NEXT_RESOURCE_VALUE 113
63 | #define _APS_NEXT_COMMAND_VALUE 40001
64 | #define _APS_NEXT_CONTROL_VALUE 1135
65 | #define _APS_NEXT_SYMED_VALUE 101
66 | #endif
67 | #endif
68 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/tuple.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | // clang-format off
18 | #include "tuple.h"
19 | #include "misc.h"
20 |
21 | #include
22 | #include
23 | // clang-format on
24 |
25 | void set_tuplefield_null(TupleField *tuple_field) {
26 | tuple_field->len = 0;
27 | // Changing value to strdup("") from NULL to fix error
28 | // "Object cannot be cast from DBNull to other types" in Excel & Power BI
29 | tuple_field->value = strdup(""); /* NULL; */
30 | }
31 |
32 | void set_tuplefield_string(TupleField *tuple_field, const char *string) {
33 | if (string) {
34 | tuple_field->len = (Int4)strlen(string); /* ES restriction */
35 | tuple_field->value = strdup(string);
36 | }
37 | if (!tuple_field->value)
38 | set_tuplefield_null(tuple_field);
39 | }
40 |
41 | void set_tuplefield_int2(TupleField *tuple_field, Int2 value) {
42 | char buffer[10];
43 |
44 | ITOA_FIXED(buffer, value);
45 |
46 | tuple_field->len = (Int4)(strlen(buffer) + 1);
47 | /* +1 ... is this correct (better be on the save side-...) */
48 | tuple_field->value = strdup(buffer);
49 | }
50 |
51 | void set_tuplefield_int4(TupleField *tuple_field, Int4 value) {
52 | char buffer[15];
53 |
54 | ITOA_FIXED(buffer, value);
55 |
56 | tuple_field->len = (Int4)(strlen(buffer) + 1);
57 | /* +1 ... is this correct (better be on the save side-...) */
58 | tuple_field->value = strdup(buffer);
59 | }
60 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/tuple.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __TUPLE_H__
18 | #define __TUPLE_H__
19 |
20 | #include "es_odbc.h"
21 |
22 | // C Interface
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Used by backend data AND manual result sets */
28 | struct TupleField_ {
29 | Int4 len; /* ES length of the current Tuple */
30 | void *value; /* an array representing the value */
31 | };
32 |
33 | /* keyset(TID + OID) info */
34 | struct KeySet_ {
35 | UWORD status;
36 | UInt2 offset;
37 | UInt4 blocknum;
38 | OID oid;
39 | };
40 | /* Rollback(index + original TID) info */
41 | struct Rollback_ {
42 | SQLLEN index;
43 | UInt4 blocknum;
44 | UInt2 offset;
45 | OID oid;
46 | UWORD option;
47 | };
48 | #define KEYSET_INFO_PUBLIC 0x07
49 | #define CURS_SELF_ADDING (1L << 3)
50 | #define CURS_SELF_DELETING (1L << 4)
51 | #define CURS_SELF_UPDATING (1L << 5)
52 | #define CURS_SELF_ADDED (1L << 6)
53 | #define CURS_SELF_DELETED (1L << 7)
54 | #define CURS_SELF_UPDATED (1L << 8)
55 | #define CURS_NEEDS_REREAD (1L << 9)
56 | #define CURS_IN_ROWSET (1L << 10)
57 | #define CURS_OTHER_DELETED (1L << 11)
58 |
59 | /* These macros are wrappers for the corresponding set_tuplefield functions
60 | but these handle automatic NULL determination and call set_tuplefield_null()
61 | if appropriate for the datatype (used by SQLGetTypeInfo).
62 | */
63 | #define set_nullfield_string(FLD, VAL) \
64 | ((VAL) ? set_tuplefield_string(FLD, (VAL)) : set_tuplefield_null(FLD))
65 | #define set_nullfield_int2(FLD, VAL) \
66 | ((VAL) != -1 ? set_tuplefield_int2(FLD, (VAL)) : set_tuplefield_null(FLD))
67 | #define set_nullfield_int4(FLD, VAL) \
68 | ((VAL) != -1 ? set_tuplefield_int4(FLD, (VAL)) : set_tuplefield_null(FLD))
69 |
70 | void set_tuplefield_null(TupleField *tuple_field);
71 | void set_tuplefield_string(TupleField *tuple_field, const char *string);
72 | void set_tuplefield_int2(TupleField *tuple_field, Int2 value);
73 | void set_tuplefield_int4(TupleField *tuple_field, Int4 value);
74 | SQLLEN ClearCachedRows(TupleField *tuple, int num_fields, SQLLEN num_rows);
75 |
76 | typedef struct _ES_BM_ {
77 | Int4 index;
78 | KeySet keys;
79 | } ES_BM;
80 |
81 | #ifdef __cplusplus
82 | }
83 | #endif
84 |
85 | #endif
86 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/unicode_support.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __UNICODE_SUPPORT_H__
18 | #define __UNICODE_SUPPORT_H__
19 |
20 | #include "es_odbc.h"
21 |
22 | #ifdef UNICODE_SUPPORT
23 | #define WCLEN sizeof(SQLWCHAR)
24 | enum { CONVTYPE_UNKNOWN, WCSTYPE_UTF16_LE, WCSTYPE_UTF32_LE, C16TYPE_UTF16_LE };
25 | char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen,
26 | BOOL tolower);
27 | SQLULEN utf8_to_ucs2_lf(const char *utf8str, SQLLEN ilen, BOOL lfconv,
28 | SQLWCHAR *ucs2str, SQLULEN buflen, BOOL errcheck);
29 | int get_convtype(void);
30 | #define utf8_to_ucs2(utf8str, ilen, ucs2str, buflen) \
31 | utf8_to_ucs2_lf(utf8str, ilen, FALSE, ucs2str, buflen, FALSE)
32 |
33 | SQLLEN bindcol_hybrid_estimate(const char *ldt, BOOL lf_conv, char **wcsbuf);
34 | SQLLEN bindcol_hybrid_exec(SQLWCHAR *utf16, const char *ldt, size_t n,
35 | BOOL lf_conv, char **wcsbuf);
36 | SQLLEN bindcol_localize_estimate(const char *utf8dt, BOOL lf_conv,
37 | char **wcsbuf);
38 | SQLLEN bindcol_localize_exec(char *ldt, size_t n, BOOL lf_conv, char **wcsbuf);
39 | SQLLEN bindpara_msg_to_utf8(const char *ldt, char **wcsbuf, SQLLEN used);
40 | SQLLEN bindpara_wchar_to_msg(const SQLWCHAR *utf16, char **wcsbuf, SQLLEN used);
41 |
42 | SQLLEN locale_to_sqlwchar(SQLWCHAR *utf16, const char *ldt, size_t n,
43 | BOOL lf_conv);
44 | #endif /* UNICODE_SUPPORT */
45 |
46 | #endif /* __UNICODE_SUPPORT_H__ */
47 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef __VERSION_H__
18 | #define __VERSION_H__
19 |
20 | /*
21 | * BuildAll may pass ELASTICDRIVERVERSION, ELASTIC_RESOURCE_VERSION
22 | * and ES_DRVFILE_VERSION via winbuild/elasticodbc.vcxproj.
23 | */
24 | #ifdef ES_ODBC_VERSION
25 |
26 | #ifndef ELASTICSEARCHDRIVERVERSION
27 | #define ELASTICSEARCHDRIVERVERSION ES_ODBC_VERSION
28 | #endif
29 | #ifndef ELASTICSEARCH_RESOURCE_VERSION
30 | #define ELASTICSEARCH_RESOURCE_VERSION ELASTICSEARCHDRIVERVERSION
31 | #endif
32 | #ifndef ES_DRVFILE_VERSION
33 | #define ES_DRVFILE_VERSION ES_ODBC_DRVFILE_VERSION
34 | #endif
35 |
36 | #endif // ES_ODBC_VERSION
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/odfesqlodbc/win_setup.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright <2019> Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License").
5 | * You may not use this file except in compliance with the License.
6 | * A copy of the License is located at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * or in the "license" file accompanying this file. This file is distributed
11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 | * express or implied. See the License for the specific language governing
13 | * permissions and limitations under the License.
14 | *
15 | */
16 |
17 | #ifndef _WIN_SETUP_H__
18 | #define _WIN_SETUP_H__
19 |
20 | #ifndef INTFUNC
21 | #define INTFUNC __stdcall
22 | #endif /* INTFUNC */
23 | #define MAXDSNAME (32 + 1) /* Max data source name length */
24 | /* Globals */
25 | /* NOTE: All these are used by the dialog procedures */
26 | typedef struct tagSETUPDLG {
27 | HWND hwndParent; /* Parent window handle */
28 | LPCSTR lpszDrvr; /* Driver description */
29 | ConnInfo ci;
30 | char szDSN[MAXDSNAME]; /* Original data source name */
31 | BOOL fNewDSN; /* New data source flag */
32 | BOOL fDefault; /* Default data source flag */
33 |
34 | } SETUPDLG, *LPSETUPDLG;
35 |
36 | /* Prototypes */
37 | INT_PTR CALLBACK ConfigDlgProc(HWND hdlg, UINT wMsg, WPARAM wParam,
38 | LPARAM lParam);
39 | BOOL INTFUNC ChangeDriverName(HWND hwnd, LPSETUPDLG lpsetupdlg,
40 | LPCSTR driver_name);
41 |
42 | void test_connection(HANDLE hwnd, ConnInfo *ci, BOOL withDTC);
43 |
44 | #endif /* _WIN_SETUP_H__ */
45 |
--------------------------------------------------------------------------------