Expand description
ODBC database driver building blocks for SQLx.
This crate is being ported as an independent split driver crate. It intentionally depends on published crates from crates.io only; it does not depend on a local SQLx checkout.
§Test Setup
Fast tests do not require an ODBC data source:
cargo testIntegration smoke tests use ODBC_DATABASE_URL and skip cleanly when it is absent:
ODBC_DATABASE_URL='DSN=MyDataSource;UID=user;PWD=password' cargo test --test odbcTo run the same tests locally against a known installed driver:
scripts/test-driver.sh duckdb
DUCKDB_ODBC_DRIVER=/absolute/path/to/libduckdb_odbc.so scripts/test-driver.sh duckdb
ODBC_DATABASE_URL='DSN=MyDataSource;UID=user;PWD=password' scripts/test-driver.sh customODBC_DATABASE_URL may be a standard ODBC connection string, a bare DSN name, or the legacy
odbc: form:
DSN=MyDataSource
Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=test
FILEDSN=/path/to/file.dsn
odbc:DSN=MyDataSource
MyDataSourceNative requirements are provided by the operating system:
- Unix-like systems need an ODBC driver manager such as
unixODBC. - A database-specific ODBC driver must be installed and visible to the driver manager.
- DSN names must be configured in the driver manager’s usual files or registry locations.
- Buffered fetching can truncate long text or binary values when
max_column_sizeis set. - Enable the
vendored-unix-odbcfeature to statically link the unixODBC driver manager.
Modules§
- any
- Runtime
Anydriver support for ODBC.
Structs§
- Odbc
- ODBC database marker for SQLx-core traits.
- Odbc
Arguments - Argument buffer for ODBC queries.
- Odbc
Buffer Settings - Fetch-buffer settings used by the ODBC driver.
- Odbc
Column - Column metadata for an ODBC row or statement.
- Odbc
Connect Options - Connection options for an ODBC data source.
- Odbc
Connection - Blocking ODBC connection wrapper.
- Odbc
Database Error - Database error details extracted from ODBC diagnostics.
- Odbc
Parameter Collection - Owned ODBC parameter storage ready to bind with
odbc-api. - Odbc
Query Result - Result summary for an ODBC query.
- OdbcRow
- Minimal ODBC row container used by the SQLx-core skeleton.
- Odbc
Statement - Prepared statement metadata for ODBC.
- Odbc
Transaction Manager - Transaction manager placeholder for ODBC.
- Odbc
Type Info - Type information for an ODBC value.
- Odbc
Value - A small owned ODBC value representation used by unit tests and Any-mapping work.
Enums§
- Odbc
Argument Value - Values that can currently be bound to ODBC parameters.
- Odbc
Error - Error type returned by this crate while the SQLx driver port is in progress.
- Odbc
Value Kind - Supported owned ODBC value kinds.
Traits§
- Data
Type Ext - Helper predicates for
odbc-apidata type groups. - Odbc
Executor - An alias for
Executor<'_, Database = Odbc>.
Type Aliases§
- Odbc
Pool - An alias for
Pool, specialized for ODBC. - Odbc
Pool Options - An alias for
PoolOptions, specialized for ODBC. - Odbc
Transaction - An alias for
Transaction, specialized for ODBC. - Result
- Result alias for this crate.