Skip to content

Commit 2ef1213

Browse files
committed
refactor(odbc): store nullability separately
This commit refactors the OdbcValueVec enum by removing nullable variants and consolidating the handling of null values into a separate nulls vector. The conversion function for AnySlice is updated to return both the value vector and the nulls vector, improving the overall structure and clarity of the code. Additionally, the value retrieval methods are simplified to utilize the new nulls handling approach.
1 parent 247bc3d commit 2ef1213

File tree

2 files changed

+113
-169
lines changed

2 files changed

+113
-169
lines changed

sqlx-core/src/odbc/connection/odbc_bridge.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ where
286286
fn create_column_data(slice: AnySlice<'_>, type_info: &OdbcTypeInfo) -> Arc<ColumnData> {
287287
use crate::odbc::value::convert_any_slice_to_value_vec;
288288

289+
let (values, nulls) = convert_any_slice_to_value_vec(slice);
289290
Arc::new(ColumnData {
290-
values: convert_any_slice_to_value_vec(slice),
291+
values,
291292
type_info: type_info.clone(),
293+
nulls,
292294
})
293295
}

0 commit comments

Comments
 (0)