All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
19.0.2 - 2025-09-23
- Fix mismatched lifetime syntaxes
- formatting
- Fix more typos and grammar issues
- Fix typos and grammar issues
- Fix typos in Readme.md
- (deps) bump anyhow from 1.0.99 to 1.0.100
19.0.1 - 2025-09-19
- Highlight warnings about caveats of asynchronous polling mode.
- (deps) bump tempfile from 3.21.0 to 3.22.0
- move async_stream_of_rows_from_other_thread up, since it is not a
- Verify static ownership of row stream
19.0.0 - 2025-09-08
- Fixed a soundness issue with non-
Sendparameters being allowed to
18.0.1 - 2025-09-08
- update to odbc-sys 0.27
- use next_blob_param helper also in
execute
18.0.0 - 2025-09-08
- Allow for async row streams to be Send
StatementImplandStatementRefare nowSend
- [breaking]
Statement::num_result_colsnow takes a&mut selfinstead of
- Update to odbc-sys 26
- Fix broken reference
- Minor improvemnts to doc comments
- (deps) bump log from 0.4.27 to 0.4.28
- (deps) bump tempfile from 3.20.0 to 3.21.0
- (deps) bump thiserror from 2.0.15 to 2.0.16
- (deps) bump thiserror from 2.0.14 to 2.0.15
- (deps) bump proc-macro2 from 1.0.97 to 1.0.101
- (deps) bump syn from 2.0.105 to 2.0.106
17.0.0 - 2025-08-18
- ConnectionTransition::into_preallocated
- It is now possible to create
Preparedstatements owning aSharedConnectiondue toSharedConnectionimplementingConnectionTransition - It is now possible to create
Preparedstatements owning aArc<Connection>due toArc<Connection>implementingConnectionTransition
- [breaking] Repalce
odbc_api::shared_connection_into_cursorwithConnectionTransition::into_cursor - [breaking]
Prepared::into_statementis now namedinto_handle. Connection::execute_arcis replaced byConnectionTransition::into_cursor- [breaking]
ConnectionAndErroris now a type alias toFailedStateTransition - [breaking] Removed
Connection::into_sys
16.0.0 - 2025-08-16
shared_connection_into_cursorallows cursors to share ownership- Add type alias SyncConnection
- Simplify
execute_arc - [breaking] Rename
ConnectionOwnertoStatementParent. - Improved documentation around Send for Connections
15.0.0 - 2025-08-14
- Cursors can now have shared ownership over
Connections usingexecute_arc.
- All of
Statements method now require&mut self
- execute_with_parameters now takes a statement instead of a lazy_statement
- [breaking] Introducing ConnectionOwner trait in order to decuple statement_connection from Connection
- [breaking] move StatementConnection into handles submodule
- [breaking] AsHandle is now named AnyHandle
- (deps) bump anyhow from 1.0.98 to 1.0.99
- (deps) bump thiserror from 2.0.12 to 2.0.14
- StatementConnection takes Connection as generic argument,
- formatting
- (deps) bump syn from 2.0.104 to 2.0.105
- (deps) bump proc-macro2 from 1.0.96 to 1.0.97
- (deps) bump proc-macro2 from 1.0.95 to 1.0.96
14.3.0 - 2025-08-10
- Check for option value changed during bulk fetch
- Add SqlResult::into_result_without_logging
- Introduce DiagnosticStream
- Introduce
SqlResult::has_diagnostics
- fix mismatched lifetime elision syntax
- fix clippy lints
- [breaking] Replace
SqlResult::into_result_optionwith - [breaking] Replaced SqlResult::into_result_with with
- (deps) bump tokio from 1.47.0 to 1.47.1
- Revert version change
- reset version to 14.2.0 so release-plz, picks it up again
14.2.1 - 2025-07-31
- Render documentation of derive feature on docs.rs
- (deps) bump winit from 0.30.11 to 0.30.12
- (deps) bump tokio from 1.46.1 to 1.47.0
- (deps) bump criterion from 0.6.0 to 0.7.0
14.2.0 - 2025-07-23
- Fetch row_array_size from statement handle
- formatting (mostly)
- Mention Fetch derive macro in RowVec doc comment
14.1.0 - 2025-07-20
- Add resize for ColumnarBulkInserter
- AnyBuffer is resize
- ColumnWithIndicator is Resize
- implement Resize for Vec
- Implement resize for wide text column buffers
- Implement Resize for Text and Binary column buffers
- Typo in parameter module documentation
- (deps) bump tokio from 1.46.0 to 1.46.1
- (deps) bump tokio from 1.45.1 to 1.46.0
14.0.2 - 2025-06-29
- Link
InputParameterdocumentation to parameter module level documentation.
14.0.1 - 2025-06-29
- Improved discoverability of supported input parameters
- All types which are CElement and HasDataType are now InputParameter
14.0.0 - 2025-06-26
- Support for saving memory through binding one input parameter two multiple placeholders, in cases there these placeholders are supposed to be replaced withe the same values. In order to achieve this the methods
Prepared::into_columnar_inserter_with_mappingandPrepared::column_inserter_with_mappinghane been added.
- [breaking]
Prepared::unchecked_bind_columnar_array_parametersnow takes an explicit mapping - [breaking]
ColumnarBulkInserter::newnow takes an explicit mapping
13.1.0 - 2025-06-25
- Add
NullableSlice::getto access n-th element without iterating
- Mention that get can panic for TextColumnView::get
- (deps) bump env_logger from 0.11.6 to 0.11.8
- Explain why Connection is not
Sync - (deps) bump tokio from 1.45.0 to 1.45.1
- bulk fetch dates
- use non-deprecated black box from standard library
- (deps) bump syn from 2.0.103 to 2.0.104
- (deps) bump syn from 2.0.102 to 2.0.103
- (deps) bump syn from 2.0.101 to 2.0.102
- unit test expansion of derive Fetch macro
13.0.1 - 2025-05-21
- document how to fetch nullable values with get_data
- (deps) bump winit from 0.30.10 to 0.30.11
- (deps) bump tempfile from 3.19.1 to 3.20.0
- (deps) bump criterion from 0.5.1 to 0.6.0
13.0.0 - 2025-05-18
- [breaking] Move prompting for connection string to "prompt" feature (#720)
- Explaining the
promptfeature. - learning test for concise type reported for time
- (deps) bump tokio from 1.44.2 to 1.45.0
- Add 2Byte Character in UTF16 to umlaut test
- umlaut in column name
- fix test Column Description for date
- Column Description for date
12.2.0 - 2025-05-01
- Adds
Nullability::could_be_nullable
12.1.0 - 2025-05-01
ResultSetMetadata::col_nullabilitycan now be used to fetch information about the nullability of a result set column.
- Conscise data types for timestamps of all tested DBMs
- (deps) bump winit from 0.30.9 to 0.30.10
- learning test for concise type of Datetime2
- Update comments on DataType Other
- (deps) bump syn from 2.0.100 to 2.0.101
12.0.2 - 2025-04-27
DataType::utf8_lenandDataType::utf16_lennow also account for special characters ifDataTypeisLongVarcharorWLongVarcharSqlDataType::EXT_W_LONG_VARCHARis now mapped toDataType::WLongVarcharrather thanDataType::Other.
Together these fixes should enable downstream crates like arrow-odbc to allocate large enough buffers for fetching strings with special characters even large relational types like VACHAR(1000) are used with PostgreSQL.
- Fix test assertions for non-windows platforms
- Import transmute from mem rather than intrinsic namespace
- (deps) bump anyhow from 1.0.97 to 1.0.98
- Added MacPorts
12.0.1 - 2025-04-10
decimal_text_to_i*Bits*Avoid panics in cases the scale in the text representation exceeds the passed scale
- Test formatting
- (deps) bump tokio from 1.44.1 to 1.44.2
12.0.0 - 2025-04-05
- Bulk inserting WChar now automatically uses 'DataType::WLongVarchar' for long strings
- [breaking] Using strings longer than 4000 characters as parameters with MSSQL.
- build error for narrow feature
- (deps) bump log from 0.4.26 to 0.4.27
- (deps) bump tempfile from 3.19.0 to 3.19.1
- (deps) bump widestring from 1.1.0 to 1.2.0
- (deps) bump tempfile from 3.18.0 to 3.19.0
- (deps) bump tokio from 1.44.0 to 1.44.1
- (deps) bump tokio from 1.43.0 to 1.44.0
- (deps) bump thiserror from 2.0.11 to 2.0.12
- (deps) bump tempfile from 3.17.1 to 3.18.0
- (deps) bump anyhow from 1.0.96 to 1.0.97
- lints doc comments
- [breaking] Update to edition 2024
- (deps) bump log from 0.4.25 to 0.4.26
- (deps) bump anyhow from 1.0.95 to 1.0.96
- (deps) bump quote from 1.0.39 to 1.0.40
- (deps) bump syn from 2.0.99 to 2.0.100
- (deps) bump syn from 2.0.98 to 2.0.99
- (deps) bump quote from 1.0.38 to 1.0.39
11.1.1 - 2025-02-19
- Return type of decimal_text_to_i32 is now indeed i32 and no longer i64
11.1.0 - 2025-02-19
- Add conversion functions decimal_text_to_i64, decimal_text_to_i32
- (deps) bump tempfile from 3.17.0 to 3.17.1
- (deps) bump tempfile from 3.16.0 to 3.17.0
11.0.0 - 2025-02-16
- [breaking] Query timeout for into_cursor
- [breaking] Introduce query timeout to Connection::execute
- Add Connection::into_preallocated
- Add missing timeout parameter to failing tests
- [breaking] PreallocatedPolling is generic over handle type
- All but into_polling of Preallocateds implementation is now generic over statment handle
- [breaking] Preallocated is now dependend on statement handle type, rather than lifetime
- More usecase centric documentation for set_query_timeout_sec
10.2.0 - 2025-02-15
- Support for query timeouts.
Preallocated::set_query_timeout_secandPrepared::set_query_timeout_seccan be used to trigger a timeout error, if the first data from that statement exceeds the time limit. This requires driver support.
- query timeout
- (deps) bump winit from 0.30.8 to 0.30.9
- (deps) bump tempfile from 3.15.0 to 3.16.0
- (deps) bump log from 0.4.22 to 0.4.25
- (deps) bump thiserror from 2.0.10 to 2.0.11
- (deps) bump tokio from 1.42.0 to 1.43.0
- (deps) bump thiserror from 2.0.9 to 2.0.10
- (deps) bump winit from 0.30.7 to 0.30.8
- (deps) bump tempfile from 3.14.0 to 3.15.0
- (deps) bump syn from 2.0.96 to 2.0.98
- (deps) bump syn from 2.0.95 to 2.0.96
- (deps) bump syn from 2.0.94 to 2.0.95
10.1.1 - 2025-01-03
- Improve panic message on invalid indicator values
10.1.0 - 2025-01-02
- autodetect homebrew library path during build
- (deps) bump thiserror from 2.0.8 to 2.0.9
- (deps) bump anyhow from 1.0.94 to 1.0.95
- (deps) bump winit from 0.30.5 to 0.30.7
- (deps) bump env_logger from 0.11.5 to 0.11.6
- (deps) bump thiserror from 2.0.7 to 2.0.8
- (deps) bump thiserror from 2.0.6 to 2.0.7
- (deps) bump thiserror from 2.0.4 to 2.0.6
- (deps) bump thiserror from 2.0.3 to 2.0.4
- (deps) bump anyhow from 1.0.93 to 1.0.94
- (deps) bump tokio from 1.41.1 to 1.42.0
- (deps) bump syn from 2.0.93 to 2.0.94
- (deps) bump syn from 2.0.92 to 2.0.93
- (deps) bump syn from 2.0.91 to 2.0.92
- (deps) bump quote from 1.0.37 to 1.0.38
- (deps) bump syn from 2.0.90 to 2.0.91
- (deps) bump syn from 2.0.89 to 2.0.90
10.0.0 - 2024-11-24
- [breaking]
odbc-apiwill now use narrow function calls by default on non-windows systems. This assumes that the ODBC driver on that platform uses UTF-8 encoding. This is usually the case as many Linux systems use an UTF-8 locale. Outside of windows the wide function calls are usually less battle tested on drivers. Downstream artefacts likearrow-odbcandodbc2parquettherefore have been compiling with thenarrowflag on non-windows systems for quite a while now to opt into the behavior which most likely works by default. However if somebody had a non-windows platform with a non-utf 8 local and a driver which actually could use UTF-16, he could not set appropriate compiler flags to revert thenarrowfeature added by these crates. Since the default behavior for each platform is now triggered byodbc-apiitself, downstream artefacts can overwrite it both ways. E.g. using thenarrowflag on windows to get some speed, if they know their target platform has a UTF-8 local configured. Or the other way around using thewideflag on a Linux system to e.g. handle special character in column names, which only seem to work with the wide variants of the drivers. So if you usedodbc-apipreviously on Linux without any flags it did by default use thewidefunction calls. It now uses thenarrowones by default. If you want the old behavior just specify thewidefeature flag. For windows users nothing breaks.
- (deps) bump thiserror from 2.0.0 to 2.0.3
- (deps) bump csv from 1.3.0 to 1.3.1
- (deps) bump tempfile from 3.13.0 to 3.14.0
- (deps) bump tokio from 1.41.0 to 1.41.1
- (deps) bump thiserror from 1.0.68 to 2.0.0
- (deps) bump anyhow from 1.0.92 to 1.0.93
- (deps) bump thiserror from 1.0.66 to 1.0.68
- (deps) bump thiserror from 1.0.65 to 1.0.66
- (deps) bump anyhow from 1.0.91 to 1.0.92
- (deps) bump syn from 2.0.87 to 2.0.89
- (deps) bump syn from 2.0.86 to 2.0.87
- (deps) bump syn from 2.0.85 to 2.0.86
ConcurrentBlockCursoris now generic over the buffer type
- Fix failed release 8.1.3 due to out of sync version for derive package
- Fix: Failed attempts to rollback transactions during
Dropof a connection will no longer panic.
- Fix:
Connection::execute_pollingdid not enable asynchronus execution on the statement handle. This means that the operations on that cursor were actually blocking even if the driver does support polling.
- Fix release. Release from main branch
ConnectionAndErrornow implementsstd::error::Error.
- Fix: Fix version of
odbc-api-derivecrate
Connection::into_cursornow allows you to recover theConnectionin case of failure. For this the return type has been changed fromErrortoConnectionAndError.ErrorimplementsFrom<ConnectionAndError>, so converting it to Error via?is frictionless.
- Improved documentation
- Update dependencies
- Fix: Add metadata for
odbc-api-derivecrate
- Fix: Release pipeline for derive feature
- Adds derive feature for deriving custom implementations of
FetchRow.
- Adds support for row wise bulk fetching via
RowVec.
- Removed
Quirks. Detection of driver problems via dbms name is not relyable enough. - Support setting packet size, via
ConnectionOptions::packet_size.
- Fixes an issue with
decimal_text_to_i128, which caused a negative value to be treated as positive, if it had been below a magnitude of one. Thanks to @timkpaine for reporting and fixing the issue.
- Fixes an issue with
Environment::drivers, which caused it to have at most one driver attribute in theDriverInfoattributes.
ConcurrentBlockCursor::from_block_cursoris now infalliable.Quirks::indicators_returned_from_bulk_fetch_are_memory_garbagewill be now set for every database name which starts withDB2.
- Adds
ConcurrentBlockCursorto ease fetching large result sets in a dedicated system thread.
- removed reexport of
force_send_sync. It is no longer used withinodbc-apithis should have been removed together with the methods which were promoting Connections toSend, but has been overlooked. - Adds
decimal_text_to_i128a useful function for downstream applications includingodbc2parquetandarrow-odbc.
- Introducing
Quirksto document knoweldege about behaviour from drivers which is different from the ODBC specification. This can be helpful for generic applications in order to support databases if they want to invest in workarounds for bugs or percularities of ODBC drivers.
- Additional
debuglog messages around allocating and deallocating handles.
ResultSetMetadata::col_display_sizenow returnsOption<NonZeroUsize>instead ofisize.ResultSetMetadata::col_octet_lengthnow returnsOption<NonZeroUsize>, instead ofisize.ResultSetMetadata::utf8_display_sizesnow iterates overOption<NonZeroUsize>, instead ofusize.DataTypenow stores the length of variadic types asOption<NonZeroUsize> insteaf ofusize.DataType::display_sizenow returnsOption<NonZeroUSize>instead ofOption<usize>.DataType::utf8_lennow returnsOption<NonZeroUSize>instead ofOption<usize>.DataType::utf16_lennow returnsOption<NonZeroUSize>instead ofOption<usize>DataType::column_sizenow returnsOption<NonZeroUSize>instead ofusizeBufferDesc::from_data_typenow returnsNonefor variadic types without upper bound instead of a zero sized buffer.Indicator::value_lennow is namedIndicator::length.- Provide buffer index for truncation errors
- Setting only
odbc_version_3_5without deactivating default features now compiles again. It is still recommended though to use theodbc_version_3_5flag only in combination with--no-default-featuressinceodbc_version_3_8is a default feature.
ParameterDescription::nullablehas been renamed toParameterDescription::nullability- Remove deprecated function
Connection::promote_to_send. ErrorUnsupportedOdbcVersionis now returned if driver manager emits a diagnostic record using with statusS1009then setting ODBC version. That status code used to mean "Invalid Attribute" back in the days of ODBC 2.x.
- Adds
BlockCursor::row_array_size, in order to infer maximum batch size without unbinding the row set buffer first. This allows downstreamarrow-odbcfor a faster implementation then creating a double buffered concurrent stream of batches directly from a block cursor.
It is now better possible to use odbc-api with multithreading in completly safe code.
Connectionis nowSend.StatementConnectionis nowSend.
According to the standard this is guaranteed to be safe. By now this has also worked in practice long enough and with enough different drivers, that this can be considered safe, not only by the ODBC standard, but also in practice.
- Variant
Error::TooLargeValueForBuffernow has a memberindicator, indicating the size of the complete value in the DBMS. This has been introduced to help users decide how to pick a maximum string size in bulk fetches, in the presence of large variadic columns.
- Fix:
Cursor::fetch_with_truncation_checkdid erroneously report truncation errors forNULLfields, if the query also triggered any ODBC diagnostic. This has been fixed in the previous release for variadic binary column buffers but a similar failure had been missed for variadic text columns.
- Fix:
Cursor::fetch_with_truncation_checkdid erroneously report truncation errors forNULLfields, if the query also triggered any ODBC diagnostic. This remained undedected for a while, because in every situation that there is a truncation, there must also be a diagnostic according to the ODBC standard. However the reverse is not true. In this situation aNULLhad been erronously treated the same as aNO_TOTALindicator and a false positive has been reported to a user claiming that there is a truncation, there in fact is none.
- Introduced
CursorRow::get_wide_textin order to fetch large UTF-16 values into a buffer. - The
IntoParameterimplementation forstrslices andStringswill now be converting them toVarWCharBoxif thenarrowcompile time feature is not activated. This has been done in order to allow for easier writing of portable code between Windows and non-Windows platforms. Usually you would like to activate thenarrowfeature on non-windows platform there a UTF-8 default locale can be assumed. On Windows you want utilize UTF-16 encoding since it is the only reliable way to to transfer non ASCII characters independent from the systems locale. With this change on both platforms one can now simply write:
// Uses UTF-16 if `narrow` is not set. Otherwise directly binds the UTF-8 silce.
conn.execute(&insert_sql, &"Frühstück".into_parameter()).unwrap();// Guaranteed to use UTF-16 independent of compiliation flags.
let arg = U16String::from_str("Frühstück");
conn.execute(&insert_sql, &arg.into_parameter()).unwrap();// Guaranteed to use UTF-8 independent of compiliation flags. This relies on the ODBC driver to use
// UTF-8 encoding.
let arg = Narrow("Frühstück");
conn.execute(&insert_sql, &arg.into_parameter()).unwrap();- Corrected typos in documentation. Thanks to @zachbateman
- Support for
U16StringandOption<U16Str>as input parameter viaIntoParametertrait. - Added
VarWCharSlice,VarWCharBox,VarWCharSliceMut,VarWCharArray.
- Support
U16StrandOption<U16Str>as input parameter viaIntoParametertrait.
- Fix:
Statement::complete_asyncis now annotated to be only available in ODBC version 3.8. This missing annotation prevented compilation then specifying ODBC version 3.5.
CursorRow::get_variadicis now private as it was always intended to be a private implemenatation detail.Statement::set_num_rows_fetchedhas been split intoStatement::set_num_rows_fetchedandStatement::unset_num_rows_fetchedin order to reduce the amount of unsafe code a bit.- Adds
Cursor::more_resultsto support statements which return multiple result sets.
-
Added support for login timeout, i.e. the user can now explicitly specify a time in seconds after which a login attempt to a datasource should fail. This triggered two breaking changes:
-
Environment::connect_with_connection_stringnow takes an additional argumentConnectionOptions. -
Environment::connectnow takes an additional argumentConnectionOptions.
Migration is trivial, by supplying ConnectionsOptions::default() as the last argument.
- Added catalog function
foreign_keystoConnectionandPreallocated.
CursorRow::get_textorCursor::get_binarynow panics if theSQLGetDataimplementation of the ODBC driver reports inconsistent indicator for the same cell. Previously it could have looped forever.
- Introduced common implementation
VarCellforVarBinaryandVarChar.
- Changed checking of truncated values after fetch. The new method checks the indicator buffer, rather than relying on diagnostics. This means
Error::TooManyDiagnosticscan no longer occurr.
- Better error messages if checking for truncation fails due to too many diagnostics
- Removed deprecated
BufferDescriptionBufferKind
- Removed deprecated names
AnyColumnBufferAnyColumnSliceMutAnyColumnViewRowSetCursorRowSetCursorPolling
- Improved support for fetching parameter descriptions of prepared statements:
- Introduced method
Prepared::num_params - Introduced method
Prepared::parameter_descriptions
- Introduced method
- Introduced method
Prepared::column_inserterto replacePrepared::any_column_inserter. - Introduced method
Prepared::into_column_inserterto replacePrepared::into_any_column_inserter.
- Introduced associated method
Item::buffer_descto replaceItem::BUFFER_KIND.
BufferKindandBufferDescriptionare now unified toBufferDesc.- Renamed
RowSetCursorintoBlockCursor. - Fix:
ColumnarBulkInserter::newnow resets all parameters on the statement handle in case it fails. This prevents accessing the bound parameters on a borrowed statement handle after the constructor failed, at which point their valididty is no longer guaranteed.
sys::Timestampis now directly supported withget_data.InputParameteris now implying the newCElementtrait.
- Removed
ColumnProjectiontrait. ColumnBuffernow has generic associated typeViewinstead of inheriting fromColumnProjection.WithDataTypecan now also be used to annotate the Relational type onTimestamp.WithDataType<Timestamp>now implementsOutputParameter.- Minimum Rust version is 1.65.0
- Fix: There has been an issue with fetching text values using
get_textfrom adb2System.db2is not part of the test suite (yet?), so not entirely sure that it is truly gone yet, but chances are its fixed. - Implement
ColumnarBufferforVec<T>.
TextBufferRowSet::for_cursornow applies the upper bound column size limits also to buffers if the metadata indicates a size of0. This allows e.g. fetching values from Microsoft SQL Server columns with typeVARCHAR(max).
- Updated documentation for
BufferDescriptionandDataType.
- Fetching diagnostic records now starts with a message buffer size of 512 instead of 0 in order to recduce calls to
SQLGetDiagRec.
SqlResulthas now new variantsSqlResult::NoDataandSqlResult::NeedData.SqlResult::into_result_with_trunaction_checkhas been replaced bySqlResult::into_result_with.handles::Environment::driver_connectnow returnsSqlResult<()>instead ofSqlResult<bool>.handles::Environment::drivers_buffer_fillnow returnsSqlResult<()>instead ofSqlResult<bool>.handles::Environment::drivers_buffer_lennow returnsSqlResult<(i16, i16)>instead ofSqlResult<Option<(i16, i16)>>.handles::Environment::data_source_buffer_lennow returnsSqlResult<(i16, i16)>instead ofSqlResult<Option<(i16, i16)>>.handles::Connection::executenow returns now returnsSqlResult<()>instead ofSqlResult<bool>.handles::Connection::exec_directnow returns now returnsSqlResult<()>instead ofSqlResult<bool>.handles::Statement::fetchnow returns now returnsSqlResult<()>instead ofSqlResult<bool>.handles::Statement::put_binary_batchnow returns now returnsSqlResult<()>instead ofSqlResult<bool>.
- Reserve an extra word (2 Bytes) when querying Catalog length in order to compensate for an of by one error in PostgreSQL driver when using wide character encoding. The issue would have resulted in the last letter being replaced with
\0in previous versions.
- No breaking changes. Messed up setting version. Should have been
0.48.1😅. - Asynchronous execution of one shot queries using
Connection::execute_polling. - Asynchronous bulk fetching of results using
RowSetCursorPolling.
- Both
Preallocated::row_countandPrepared::row_countnow returnOption<usize>instead ofisize.
- Support getting number of rows affected by
INSERT,UPDATEorDELETE.- New method
Preallocated::row_count - New method
Prepared::row_count
- New method
TextRowSet::from_max_str_lensnow takesIntoIterator<Item=usize>instead ofIterator<Item=usize>.- trait method
RowSetBuffer::bind_to_cursorhas been renamed tobind_columns_to_cursorand now takes aStatementRefinstead of aCursor. This change is unlikely to affect user code, as so far I know all downstream crates use the providedRowSetBufferimplementations and do not implement their own versions.
- Minimal support for asynchronous code in the
handlemodule. SqlResulthas a new variantSqlResult::StillExecuting.- New function
Statement::set_async_enablecan be used to enable polling for statements. - Functions returning
Option<SqlResult<_>>now returnSqlResult<Option<_>>orSqlResult<bool>in order to allow for top level asynchronous code to build on the same abstraction as the synchronous code.
Since most users would not engage with the unsafe functions of the handle module their code should be unaffected.
TextRowSet::for_cursornow only performs a faliable allocation, if no upper bound for string length is specified. This has been changed to remidy performance regressions, but still have the faliable allocation in situation there it could likely occurr.
- Add
Connection::into_preparedto allow for prepared queries to take ownership of the connection. Prepared::describe_paramnow requires an exclusive reference- Remove
Prebound.
- Add
NullableSliceMut::set_cell
- Add
Bit::from_bool.
- Add
ColumnarBulkInserter::capacity.
- All methods on the
ResultSetMetaDatatrait now require exclusive (&mut) references. - The trait
BorrowMutStatementhas been replaced byAsStatementRef. ColumnarBulkInserteris now generic over statement ownership.- It is now possible to create a bulk inserter which just borrows a prepared statement, rather than taking ownership of it. Use
Prepared::any_column_inserterto do so. This is useful for dynamically growing the capacity of the bound array parameters. So far users were forced to create a newColumnarBulkInserterto do so. This is still true, but creating a newColumnarBulkInserternow longer implies that a new prepared statement has to be created.
BoundInputSlice,TextColumnSliceMutandBinColumnSliceMutnow only track the lifetime of the statement. The do no longer need to track the lifetime of theConnectionanymore.
- Removed
TextColumn::set_max_lenasresize_max_str_lencan do everything the former can and does it better. ColumnBufferandTextRowSetcan no longer be used to insert data into the database. It can now only be used to receive data. This is due to different invariants which must hold true for input and output buffers. The newColumnarBulkInserterwhich can be constructed usinginto_any_column_inserterorinto_text_inserteron a prepared statment closes this safety hole. It also allows for faster insertion into a database in case you transmit the data in several batches, because it does not require the user to rebind the parameter buffers in safe code. This significantly reduces the overhead for each batch.
- Refactored traits for passing parameters to
Connection::execute. Should not break user syntax, though. - Allow using fixed size paramters like
i32directly as output parameter without wrapping them into aNullablefirst. - Renamed
TextColumnWriter::rebindintoTextColumnWriter::resize_max_str - Fast insertion into database using
TextRowSetwithout rebinding parameter buffers for individual batches.
- Introduce alias for
ColumnarAnyBufferforColumnarBuffer<AnyColumnBuffer>.
-
Introduce feature
iodbc. This features enables all features required for this crate to work with the IODBC driver manager.narrowODBC function calls- Use of
odbc_version_3_5symbols and declaration of ODBC API version 3.0. - Linking of upstream
odbc-sysvsiodbcas opposed to plainodbc.
-
Introduce
ColumnDescription::newto allow for intantiatingColumnDescriptionin test cases without caring about wetherSqlCharisu8oru16.
- The fallibale allocations introduced for
buffer_from_descriptionhad performance implications. Therfore the fallibale allocations are available to users of this library totry_buffer_from_description.buffer_for_descriptionis now panicing again in case there is not enough memory available to allocate the buffers.
- Fixed an issue introduced in
0.39.1there the terminating zero at the end of diagnostic messages has not been removed correctly.
- Support for checking for truncation after bulk fetch with:
RowSetCursor::fetch_with_truncation_check.
- Add column buffer index to allocation errors to provide more context
- Add fallibale allocation of binary columns.
- Add fallibale allocation of text columns.
- Add
AnyColumnViewMut::as_text_view.
- If setting the ODBC version fails with
HY092(Invalid attribute value), the user will now see an error message stating that likely the ODBC driver manager should be updated as it does not seem to support ODBC version 3.80. This gives the user a better starting point to fix the problem than just the diagnostic record.
- Introduce
AnyColumnView::TextandAnyColumnView::WTextnow holds aTextColumnViewinstead of aTextColumnIt. To get the iterator you can just calliter()on theTextColumnView. - Introduce
AnyColumnView::Binarynow holds aBinColumnViewinstead of aBinColumnIt. - Add
AnyColumnView::as_text_view. - Add
AnyColumnView::as_w_text_view. - Add
AnyColumnView::as_slice. - Add
AnyColumnView::as_nullable_slice.
The TextColumnView has been added in order to allow for faster bindings to arrow. As it gives access to the raw value buffer.
- Allow direct access to raw buffers of
NullableSliceMut.
- Allow direct access to raw buffers of
NullableSlice. ColumnWithIndicator::iteris no longerunsafeTextColumn::indicator_atis no longerunsafeTextColumn::value_atis no longerunsafeBinColumn::value_atis no longerunsafe.BinColumn::iteris no longerunsafe.
Thanks to @jorgecarleitao for providing all the input about safety and discovering performance
bottlenecks in the buffer interfaces.
- Better error for Oracle users, then trying to fetch data into 64 Bit Buffers. Added variant
OracleOdbcDriverDoesNotSupport64Bitto error type in order to achieve this.
- Introduce feature
odbc_version_3_5. Decalaring ODBC version 3.80 is still default behaviour. The flag has mainly been introduced to achieve compatibility with iODBC.
- Introduces
narrowfeature, allowing to compile this library against narrow ODBC function calls. This is optional now, but may become default behaviour in the future on non-windows platforms (because those typically have UTF-8 locale by default.) - Removed public higher level methods directly dealing with utf16. Similar functions using unicode remain in the API. This has been done in order better support building against narrow ODBC function calls on some platforms while keeping complexity in check.
ResultSetMetadata::col_namenow returnsResult<String, Error>.Environment::driver_connectnow takes&mut OutputStringBufferinstead ofOption<&mut OutputStringBuffer>. UseOutputStringBuffer::empty()instead ofNone.- Removed
Connection::tablesnow takes&strinstead ofOption<&str>arguments. Use""instead of none - Removed
Environment::connect_utf16. - Removed
Preallocated::execute_utf16. - Removed
Connection::execute_utf16. - Removed
Connection::prepare_utf16. - Removed
OutputStringBuffer::ucstr. - Removed
Connection::fetch_current_catalog. - Removed
Connection::fetch_database_management_system_name. - updated to
odbc-sys 0.21.2
- No changes (Release is currently tied to odbcsv)
- No changes (Release is currently tied to odbcsv)
- Uses Rust Edition 2021
- Mutable references
&mut Tare no longer implicitly bound as input / output Parameters, but must be wrapped withInOutinstead. This has been done to make the decision betweenOutandInOutexplicit, and also help to avoid binding parameters asInOutby accident. Shared references&Tare still implicitly bound as input parameters however. - Renamed
ParametertoParameterRef - Renamed
Parameter::bind_parametertoParameterRef::bind_to - Renamed
OutputtoOutputParameter - Renamed
TextColumn::rebindtoTextColumn::resize_max_str. InputParameteris now longer exported in the top level namespace, but only asparameter::InputParameter.ParameterRefCollection::bind_to_statementnow takes&mut selfrather thanself.ColumnarRowSetandTextRowSetBufferare nowColumnarBuffer, which is generic over columns.ColumnarRowSet::newis nowbuffer_from_descriptions.- Removed
SqlResult::log_diagnostics.
- Removed
unsafefrom traitHasDataType. - Introduced
Prepared::into_statementandCursorImpl::newto enable usecases not covered by safe abstractions yet.
escape_attribute_valuenow also escapes+signs. This has been introduced because an authentication vs a PostgreSQL failed, if a password containing+has not been escaped.
- Fix: Some drivers (i.e. SqLite) report the size of column names in characters instead of bytes. This could cause truncation of names provided by
colum_namesif the supplied buffers were to short. Now the correct provided buffer is always resized to be large enough to hold the entire name, even for these drivers.
In order to avoid exposing the dependency to raw-window-handle in the public interface the way this library opens prompts for connecetion on windows platform has changed:
- Breaking change:
Environment::driver_connectnow automatically creates a message only window for the user on non-windows platform.DriverCompleteOptionis now a simple C-Like enumeration. - Introduced
Environment::driver_connect_with_hwndto allow power users to provide their own window handles.
- Minor improvements to documentation.
- Allows for fetching result set metadata from
Preparedstatements.- Introduced trait
ResultSetMetadata. Which is implemented by bothPreparedandCursor.
- Introduced trait
- Make
StatementConnectionpublic
- Add
into_cursorto Connection
- Improved documentation for
Connection::columns.
- Removed generic lifetime argument from
CursorImpl. - Add
Connection::tables. - Add
Preallocated::tables.
- After failing to get any race conditions with it on either Windows or Linux.
Environment::newis now considered to be safe.
- Reexport crate
force_send_sync.
- Fix:
handles::Environmentis now longer declaredSync. Due to the interior mutability regarding error states. - Fix: A lock has been added to
Environmentto ensure diagnostics for allocation errors always are handled by the correct thread.
- Add
is_emptytoNullableSliceandNullableSliceMut. - Remove
Statement::col_data_type. Method is still available via theCursortrait, though. - Replace
ErrorwithSqlReturninhandlesmodule to not make any decisions about handling diagnostics in that layer.
- Add implementation for
ExactSizeIteratorforTextColumnItandBinColumnIt.
- Add
NullableSlice::len.
- Fix:
DataType::Floatis now a struct variant holding a precision value which is either24for 32Bit Floating points or53for 64Bit Floating point numbers.
Connection::columnsandPreallocated::columnsnow return aResult<CursorImpl, Error>instead of aResult<Option<CursorImpl>, Error>sincecolumnsalways returns a Cursor.- These functions now return a
Result<u16, Error>instead of aResult<usize, Error>:Connection::max_catalog_name_lenConnection::max_schema_name_lenConnection::max_column_name_len
- Renamed
OptIttoNullableSlice. - Renamed
OptWritertoNullableSliceMut. - Added
buffer::Itemtrait to make it more convinient to extract a slice or aNullableSlicefromAnyColumnView.
handles::Nullablilitynow implementsCopy.Nullable<T>now implementsCopyifTdoes.
- Add
Error::InvalidRowArraySizewhich is returned instead ofError::Diagnosticsif invalid attribute is returned during setting row set array size.
Error::Diagnosticsis now a struct variant and also contains the name of the ODBC function call which caused the error.- Renamed
Error::OdbcApiVersionUnsupportedtoUnsupportedOdbcApiVersionto achieve consistent word order. - Fix: Row set array size is now specified in
usizerather thanu32. - Fix: Bind type is now specified in
usizerather thanu32. - Fix: Parameter set size is now specified in
usizerather thanu32.
- Fix: Code example blobs
- Fix: An issue intruduced in
0.24.0there a searched update or delete statement that does not affect any rows at the data source could cause a panic.
- Add Support for sending long data.
- Add variant
DataType::LongVarChar. - Add variant
DataType::LongVarBinary. - Add variant
Error::FailedReadingInput. - trait
HasDataTypeno longer implies traitCData.
- Adds
Connection::columns - Adds
Connection::columns_buffer_description
These wrap the ODBC SqlColumns function and represent anoter way to obtain schema information.
Thanks to @grovesNL for the contribution.
- Add support for Connection Pooling
- Add methods for exposing metadata to SQLColumns based queries (Thanks again to @grovesNL).
- Better error message in case ODBC Api version is set on older version of unixODBC.
- Introduced
OdbcApiVersionUnsupportedvariant to Error type. - Changed ODBC state representation in diagnostic to narrow ASCII characters.
- Introduced
-
Fix:
VarCharBox::null()had been bound asVARCHAR(0). This caused an error with Access and older versions of Microsoft SQL Server ODBC Driver. To fix thisVarCharBox::null()is now bound asVARCHAR(1). Thanks to @grovesNL for finding and investigating the issue.Analoge issues also fixed for:
VarBinarySlice::NULLVarBinaryBox::null()
- Fix:
VarCharSlice::NULLhad been bound asVARCHAR(0). This caused an error with Access and older versions of Microsoft SQL Server ODBC Driver. To fix thisVarCharSlice::NULLis now bound asVARCHAR(1). Thanks to @grovesNL for finding and investigating the issue. - Support access to raw
odbc-sysfunctionality. This is done to support use cases for which a safe abstraction is not yet available (like streaming large values into the database).- Add
preallocated::into_statement. - Add
StatementImpl::into_sys. - Add
StatementImpl::as_sys. - Add
Statement::param_data
- Add
-
Support for passing binary data as parameter.
VarBinarySlice- immutable borrowed parameter.VarBinarySliceMut] - mutable borrowed input / output parameterVarBinaryArray- stack allocated owned input / output parameterVarBinaryBox- heap allocated owned input / output parameter&[u8]now implementsIntoParameter.Vec<u8>now implementsIntoParameter.
-
Introduced
CursorRow::get_binaryto fetch arbitrary large blobs into aVec<u8>. -
Fix:
VarCharArray::newis now placing a terminating zero at the end in case of truncation. As statet in the documentation.
- Add
Environment::driver_connectwhich forwards more functionality fromSqlDriverConnect. In particular it is now possible (on windows systems) to complete connection strings via the dialog provided by the ODBC driver and driver manager. Errorhas new variant:Error::AbortedConnectionStringCompletion. Which occurs if the GUI for completion is closed before returning any data.
Thanks to @grovesNL for the contribution.
Environment::driversnow takes&selfinstead of&mut self.Environment::data_sourcesnow takes&selfinstead of&mut self.Environment::user_data_sourcesnow takes&selfinstead of&mut self.Environment::system_data_sourcesnow takes&selfinstead of&mut self.handles::Environment::drivers_buffer_lennow isunsafeand takes&selfinstead of&mut self.handles::Environment::drivers_buffer_fillnow isunsafeand takes&selfinstead of&mut self.handles::Environment::data_source_buffer_lennow isunsafeand takes&selfinstead of&mut self.handles::Environment::data_source_buffer_fillnow isunsafeand takes&selfinstead of&mut self.
Thanks to @grovesNL for the contribution.
- Test are now also executed against Maria DB
- Add
BufferDescription::bytes_per_row. - Add function
escape_attribute_value.
- Required at least Rust 1.51.0 to compile.
IntoParameterhas been implement forString. This is the most likely thing to break your code as calling.into_parameter()would have worked onStringbefore, but would have invoked the implementation onstr. Should you want the old behaviour just callmy_string.as_str().into_parameter().- Replaced
VarCharRefwithVarCharSlice. - Replaced
VarChar32andVarChar512withVarCharArray<LENGTH>. - Replaced
VarCharMutwithVarCharSliceMut. VarChar::copy_from_byteshas been removed. Try constructing withnew,from_bufferor usingNULLinstead.VarChar::indicator()now returns anIndicatorinstead of anisize.- Replaced
VarCharRef::null()withVarCharSlice::NULL. - Support
CStringandCStras input parameters.
Box<dyn InputParameter>now implementsInputParameter.
- Fix:
BinColumnWriter::appenderroneously inserted a terminating zero at the end of the value.
- Fix: Timestamps buffers are now bound with a default precision of 7 (100ns) in order to avoid an 'invalid precision' error than inserting (occurred with MSSQL). Previously the precision had been 9 (1ns).
Increased support for adaptive buffering during inserts using ColumnarRowSet:
- Add
TextColumnWriter::append. - Add
TextColumnWriter::max_len. - Add
TextColumnWriter::rebind. - Add
BinColumnWriter::max_len. - Add
BinColumnWriter::rebind. - Add
BinColumnWriter::append.
Support for directly writing formatted text with fixed length to the underlying buffers.
- Add
TextColumn::set_mut. - Add
TextColumnWriter::set_mut.
- Add
TextColumnWriter::set_value.
- Fix:
Statement::col_data_typenow returnsDataType::WCharinstead ofDataType::Otherthen appropriate. - Fix: An out of bounds panic with columnar inserts from text buffer, if the last value of the buffer had maximum length in a buffer with the maximum number of rows filled (yes, off by one error).
- Add variant
DataType::WCharfor fixed sized UTF-16 character data. - Add method
DataType::utf16_len.
CursorRow::get_textnow returnsboolwithfalseindicating aNULLfield.TextColumnis now generic over its character type. The type aliasCharColumnforTextColumn<u8>can serve as a drop in replacement for the previous iteration ofTextColumn.AnyColumnBufferhas a new variant calledWTextholding a UTF-16TextColumn<u16>orWCharColumn.TextRowSet::for_cursorhas a new parametermax_str_lento designate the upper limit for column buffer size.- Add
TextRowSet::indicator_atto allow checking for truncation of strings.
- Introduces
Cursor::next_rowto fetch data without binding buffers first. - Allow retrieving arbitrarily large strings from the data source.
- Removed
RowSetCursor::unbinddue to soundness issue, if fetching continues without any buffers bound. - Hides internal interface of
Cursortrait behindCursor::stmt. RowSetCursornow implementsDrop.Statement::set_num_rows_fetchednow takes an option to allow unbinding a previously set reference.- Trait
OutputParameterhas been renamed toOutput. - Trait
FixedSizedCTypehas been renamed toPod.
Cursor::fetchis now safe.- Introduced
Connection::preallocateto allow for efficient preallocation of statement handles in interactive clients. - Renamed
Connection::exec_direct_utf16intoConnection::execute_utf16.
- Text column buffers throughout the API now use
&[u8]to represent queried strings instead ofCStrto account for the possibility of interior nuls.
- Fix:
BufferKind::from_data_typenow usesdisplay_sizerather thancolumn_sizethen mappingNumericandDecimaltypes toTextbuffers. BufferKind::from_data_typenow mapsDataType::Timewithprecision> 0 toBufferKind::Textin order to avoid loosing fractional seconds.- Renamed
DataType::TinyinttoDataType::TinyIntin order to be consistent withDataType::SmallInt. - Renamed
DataType::BiginttoDataType::BigIntin order to be consistent withDataType::SmallInt. - Removed Application Row Descriptor handle. Likely to be reintroduced later though.
ColumnarRowSetnow has support for variadic binary data types.- Add support for binary data types.
- Add support for transactions.
- Add support for bulk inserts to
ColumnarRowSet. - New section about inserting values in the guide.
- Add support for output parameters in stored procedures.
- Input parameters now must be bound by reference.
- Input/output parameters are bound by mutable reference.
Inputhas been renamed toHasDataType.Nullablehas been renamed toNullability.- Update to odbc-sys 0.17.0.
- Add
ColumnarRowSet::with_column_indices, to enable binding only some columns of a cursor object. - Struct
DataSourceInfois now public - Associated function of
Cursorcol_typeandcol_concise_typehave been removed in favor ofcol_data_type. - Add
DataType::utf8_len. - Fix:
TextRowSet::for_cursornow allocates 4 times larger buffers for character data, in order to have enough space for larger utf-8 characters.
- Fix: There has been an integer overflow causing a panic if an ODBC API call generated more than 2 ^ 15 warnings at once.
- Fix:
BufferKind::from_data_typenow always uses the integer type which fits best, for Decimal and Numeric types with scale0.
- Removed
Cursor::set_row_bind_type. - Removed
Cursor::set_row_array_size. - Removed
Cursor::set_num_rows_fetched. RowSetBuffertrait now requires an implementation ofbind_type.RowSetBuffertrait now requires an implementation ofrow_array_size.RowSetBuffertrait now requires an implementation ofmut_num_rows_fetched.- Add
Environment::data_sources. - Add
Environment::user_data_sources. - Add
Environment::system_data_sources. TextRowSetnow returnsCStrinstead of&[u8].
- Removed
Connection::promote_send_and_syncbecause it is unclear that diagnostic messages would always be pulled by the correct thread. - Adds
Environment::driversto list available ODBC drivers.
- Implement
IntoParameterforOption<&str>.
Connection::executetakes now&selfinstead of&mut self.- Support promoting
ConnectiontoSendorSync.
- Adds method
Prepared::describe_param(). handle::Statement::bind_parameterchanges intohandle::Statement::bind_input_parameter, in order take a* const.VarCharParamrenamed intoVarChar.TextRowSet::newrenamed intoTextRowSet::for_cursor.- trait
ParameterCollectionhas a new methodparameter_set_size. Parametertrait is now inheriting fromInput.ColumnBuffertrait is replaced byCDataMut.- Extended guide with section about parameter binding.
Environmentis nowSendandSync.- Fix: Executing statements not generating results now does no longer create cursors.
- Fix:
Prepared::executenow returnsResult<Option<CursorImpl<_>>, Error>instead ofResult<CursorImpl<_>, Error>. - Fix:
Cursor::executeis nowunsafe. - Fix:
Cursor::fetchis nowunsafe.
Cursor::bind_row_set_bufferis nowCursor::bind_buffer.Connection::exec_directis nowConnection::execute.- Tuple support for passing input parameters.
- Basic support for binding parameters.
- Basic support for prepared queries.
- Due to the new possibility of binding parameters
Statement::exec_directandStatement::executemust now be considered unsafe. BindColParametersrenamed toBindColArgs.
Environment::connectnow takes&strinstead of&U16Str.- Adds
Environment::connect_utf16.
- Logs all diagnostics in case driver returns multiple errors.
- Adds
Bit,OptBitColumn,OptI8Column,OptU8Column.
- Extend
ColumnDescriptionenum withBigint,TinyintandBit.
- Introduced
DataTypeinto theColumnDescriptionstruct. - Renaming: Drops
Buffersuffix fromOptDateColumn,OptF32Column,OptF64Column,OptFixedSizedColumn,OptI32Column,OptI64Column,OptTimestampColumn.
- Adds buffer implementation for fixed sized types
- Implements
FixedCSizedCTypeforodbc_sys::Time.
- Renamed
cursor::col_data_typetocursor::col_type. - Adds
cursor::col_concise_type.
- Adds
cursor::col_precision. - Adds
cursor::col_scale. - Adds
cursor::col_name.
- Add trait
buffers::FixSizedCType.
- Fix:
buffers::TextColumnnow correctly adjusts the target length by +1 for terminating zero.
Adds buffers::TextRowSet.
- Adds
col_display_size,col_data_typeandcol_octet_lengthtoCursor.
- Adds convenience methods, which take UTF-8 in public interface.
- Adds
ColumnDescription::could_be_null. - Adds
Cursor::is_unsigned.
Initial release