Skip to content

Commit

Permalink
use quirks provided by odbc_api
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Dec 16, 2023
1 parent 65ffe85 commit 6ed493c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ thiserror = "1.0.49"
# features implying the use of UTF-16 for queries, connection strings and error messages. This
# should work on any system
[target.'cfg(target_os = "windows")'.dependencies]
odbc-api = ">= 4, < 5"
odbc-api = ">= 4.1, < 5"

# On linux we assume use of a UTF-8 locale. So we set the narrow features implying that for queries,
# connection strings and error messages the driver and driver manager supply utf8-strings. This
Expand Down
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.0.1

* Update odbc-api `>= 4, < 5` -> `>= 4.1, < 5`

## 4.0.0

* Update odbc-api `>= 2.2, < 4` -> `>= 4, < 5`
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ mod date_time;
mod decimal;
mod error;
mod odbc_writer;
mod quirks;
mod reader;
mod schema;

Expand All @@ -57,7 +56,6 @@ pub use odbc_api;
pub use self::{
error::Error,
odbc_writer::{insert_into_table, insert_statement_from_schema, OdbcWriter, WriterError},
quirks::Quirks,
reader::{
BufferAllocationOptions, ColumnFailure, ConcurrentOdbcReader, OdbcReader, OdbcReaderBuilder,
},
Expand Down
34 changes: 0 additions & 34 deletions src/quirks.rs

This file was deleted.

14 changes: 5 additions & 9 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use arrow::{
use log::debug;
use odbc_api::{
buffers::{AnySlice, BufferDesc, Item},
Bit, DataType as OdbcDataType, ResultSetMetadata,
Bit, DataType as OdbcDataType, ResultSetMetadata, Quirks,
};
use thiserror::Error;

Expand All @@ -25,19 +25,15 @@ mod odbc_reader;
mod text;
mod to_record_batch;

use self::{decimal::Decimal, map_odbc_to_arrow::MapOdbcToArrow};

use crate::{
date_time::{
days_since_epoch, ms_since_epoch, ns_since_epoch, seconds_since_epoch, us_since_epoch,
},
Quirks,
use crate::date_time::{
days_since_epoch, ms_since_epoch, ns_since_epoch, seconds_since_epoch, us_since_epoch,
};

pub use self::{
binary::{Binary, FixedSizedBinary},
concurrent_odbc_reader::ConcurrentOdbcReader,
map_odbc_to_arrow::MappingError,
decimal::Decimal,
map_odbc_to_arrow::{MapOdbcToArrow, MappingError},
odbc_reader::{OdbcReader, OdbcReaderBuilder},
text::choose_text_strategy,
};
Expand Down
4 changes: 2 additions & 2 deletions src/reader/odbc_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use arrow::{
error::ArrowError,
record_batch::{RecordBatch, RecordBatchReader},
};
use odbc_api::{buffers::ColumnarAnyBuffer, BlockCursor, Cursor};
use odbc_api::{buffers::ColumnarAnyBuffer, BlockCursor, Cursor, Quirks};

use crate::{BufferAllocationOptions, ConcurrentOdbcReader, Error, Quirks};
use crate::{BufferAllocationOptions, ConcurrentOdbcReader, Error};

use super::{odbc_batch_stream::OdbcBatchStream, to_record_batch::ToRecordBatch};

Expand Down
4 changes: 2 additions & 2 deletions src/reader/to_record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use arrow::{
record_batch::RecordBatch,
};
use log::info;
use odbc_api::{buffers::ColumnarAnyBuffer, ResultSetMetadata};
use odbc_api::{buffers::ColumnarAnyBuffer, ResultSetMetadata, Quirks};

use crate::{arrow_schema_from, BufferAllocationOptions, ColumnFailure, Error, Quirks};
use crate::{arrow_schema_from, BufferAllocationOptions, ColumnFailure, Error};

use super::{choose_column_strategy, MappingError, ReadStrategy};

Expand Down
4 changes: 2 additions & 2 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ use arrow_odbc::{
odbc_api::{
buffers::TextRowSet,
sys::{AttrConnectionPooling, AttrCpMatch},
Connection, ConnectionOptions, Cursor, CursorImpl, Environment, IntoParameter,
Connection, ConnectionOptions, Cursor, CursorImpl, Environment, IntoParameter, Quirks,
StatementConnection,
},
ColumnFailure, Error, OdbcReaderBuilder, OdbcWriter, Quirks, WriterError,
ColumnFailure, Error, OdbcReaderBuilder, OdbcWriter, WriterError,
};

use stdext::function_name;
Expand Down

0 comments on commit 6ed493c

Please sign in to comment.