From 5ed2ccd9eebfa971c642d64e65058dd3d2c9ecd9 Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Fri, 10 Jun 2022 22:40:20 +0200 Subject: [PATCH] add ColumnarBulkInserter::capacity --- Cargo.lock | 4 ++-- Changelog.md | 4 ++++ odbc-api/Cargo.toml | 2 +- odbc-api/src/columnar_bulk_inserter.rs | 5 +++++ odbcsv/Cargo.toml | 4 ++-- odbcsv/Changelog.md | 8 ++++++++ 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36d4fce9..7ad1be4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,7 +849,7 @@ dependencies = [ [[package]] name = "odbc-api" -version = "0.44.0" +version = "0.44.1" dependencies = [ "anyhow", "criterion", @@ -874,7 +874,7 @@ checksum = "5fa96a125cee9f1fe33cb69d6517466afc4e9cb1f44afdcc67210e2776aec7b2" [[package]] name = "odbcsv" -version = "0.4.8" +version = "0.4.9" dependencies = [ "anyhow", "assert_cmd", diff --git a/Changelog.md b/Changelog.md index cbe47c73..a9bfbc75 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## 0.44.1 + +* Add `ColumnarBulkInserter::capacity`. + ## 0.44.0 * All methods on the `ResultSetMetaData` trait now require exclusive (`&mut`) references. diff --git a/odbc-api/Cargo.toml b/odbc-api/Cargo.toml index 323bb364..ca5cd3d1 100644 --- a/odbc-api/Cargo.toml +++ b/odbc-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "odbc-api" -version = "0.44.0" +version = "0.44.1" authors = ["Markus Klein"] edition = "2021" license = "MIT" diff --git a/odbc-api/src/columnar_bulk_inserter.rs b/odbc-api/src/columnar_bulk_inserter.rs index 952760c2..db03a69d 100644 --- a/odbc-api/src/columnar_bulk_inserter.rs +++ b/odbc-api/src/columnar_bulk_inserter.rs @@ -188,6 +188,11 @@ where .as_view_mut((buffer_index + 1) as u16, self.statement.as_stmt_ref()) } } + + /// Maximum number of rows the buffer can hold at once. + pub fn capacity(&self) -> usize { + self.capacity + } } /// You can obtain a mutable slice of a column buffer which allows you to change its contents. diff --git a/odbcsv/Cargo.toml b/odbcsv/Cargo.toml index 9b955a77..82316e37 100644 --- a/odbcsv/Cargo.toml +++ b/odbcsv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "odbcsv" -version = "0.4.8" +version = "0.4.9" authors = ["Markus Klein"] edition = "2021" license = "MIT" @@ -29,7 +29,7 @@ readme = "Readme.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -odbc-api = { version = "0.44.0", path = "../odbc-api" } +odbc-api = { version = "0.44.1", path = "../odbc-api" } csv = "1.1.6" anyhow = "1.0.57" stderrlog = "0.5.1" diff --git a/odbcsv/Changelog.md b/odbcsv/Changelog.md index 97d88075..e1d304a3 100644 --- a/odbcsv/Changelog.md +++ b/odbcsv/Changelog.md @@ -1,5 +1,13 @@ # Changelog +## 0.4.9 + +* Updated dependencies + +## 0.4.8 + +* Updated dependencies + ## 0.4.7 * Updated dependencies