Cargo Features

[dependencies]
odbc-api = { version = "9.0.0", default-features = false, features = ["narrow", "odbc_version_3_5", "odbc_version_3_80", "iodbc", "derive"] }
narrow iodbc?

Experimental feature to enabling narrow function calls.

Many functions which accept string arguments in the ODBC C API come in two different flavours. For example SQLConnect and SQLConnectW. The former are called narrow function calls and the latter are called wide. They differ in the type they used to encode characters (u8 vs u16). Sadly narrow may not always be assumed to be UTF-8 as it is dependend on the system locale which is usually not UTF-8 on windows system. The wide function calls could be relied upon to always be UTF-16 on any platform, but do not seem to work well with iodbc.

Currently this library uses wide function call exclusively. This feature can be enabled to cause compliation against narrow functions, but it is not fully implemented yet.

Note that this is the encoding used for statement text and other string arguments, not for the payload of VARCHAR columns, or other column types in the result set.

Affects column_description::utf8_to_vec_char, sql_char::SqlChar, sql_char::DecodingError, sql_char::slice_to_utf8, sql_char::slice_to_cow_utf8

odbc_version_3_5 iodbc?

odbc-api uses ODBC 3.80 by default, which is well supported both in windows and on linux through UnixODBC. Yet iodbc, for now does only support ODBC 3.5, so you can set this flag in order to include only symbols available in ODBC 3.5 and create an environment which declares the ODBC version to be 3.0 which works together with the iodbc driver manager. If you want to use ODBC 3.5 please take care to deactivate default features to not have the ODBC version 3.80 feature active at the same time.

Enables odbc_version_3_50 of odbc-sys

Low level bindings to ODBC API calls into libodbc.so

odbc_version_3_80 default

The ODBC version your application should declare if it runs on windows, or on linux using UnixOdbc.

Enables odbc_version_3_80 of odbc-sys

Affects statement::Statement.complete_async

iodbc = narrow, odbc_version_3_5

In order to work with iodbc we need to only use symbols defined in ODBC 3.5. We need to use narrow function calls and preferale link against libiodbc.so instead of libodbc.so.

Enables iodbc of odbc-sys

derive

Allows deriving custom implementations of FetchRow for row wise bulk fetching.

Enables odbc-api-derive

default = odbc_version_3_80

The odbc_version_3_80 feature is set by default whenever odbc-api is added without default-features = false somewhere in the dependency tree.