Skip to content

Commit 4b54467

Browse files
committed
Release 0.0.7 with opt-in offline metadata
1 parent c5cf3cd commit 4b54467

7 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎.github/workflows/odbc.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
- name: Run ODBC integration tests
106106
run: >-
107107
scripts/test-driver.sh "${{ matrix.driver }}"
108-
--features bigdecimal,chrono,json,rust_decimal,time,uuid
108+
--features bigdecimal,chrono,json,offline,rust_decimal,time,uuid
109109
110110
publish:
111111
name: Publish

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlx-odbc"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/sqlpage/sqlx-odbc"
@@ -16,6 +16,7 @@ bigdecimal = ["dep:bigdecimal", "sqlx-core/bigdecimal"]
1616
chrono = ["dep:chrono"]
1717
decimal = ["rust_decimal"]
1818
json = ["dep:serde", "dep:serde_json", "sqlx-core/json"]
19+
offline = ["sqlx-core/offline"]
1920
runtime-tokio = ["sqlx-core/_rt-tokio"]
2021
rust_decimal = ["dep:rust_decimal", "sqlx-core/rust_decimal"]
2122
time = ["dep:time", "sqlx-core/time"]
@@ -34,7 +35,7 @@ odbc-api = "28"
3435
rust_decimal = { version = "1.36.0", default-features = false, features = ["std"], optional = true }
3536
serde = { version = "1.0.219", features = ["derive", "rc"], optional = true }
3637
serde_json = { version = "1.0.142", features = ["raw_value"], optional = true }
37-
sqlx-core = { version = "=0.9.1", default-features = false, features = ["any", "offline"] }
38+
sqlx-core = { version = "=0.9.1", default-features = false, features = ["any"] }
3839
thiserror = "2.0.17"
3940
time = { version = "0.3.47", features = ["formatting", "parsing", "macros"], optional = true }
4041
url = "2.5.7"

‎README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ SQLx `query()` uses the driver's prepared-statement parameter count to check
5050
binds. Use `sqlx_core::raw_sql::raw_sql()` for SQL that needs direct execution
5151
without bind parameters.
5252

53+
Enable the `offline` feature to use SQLx's offline statement description API.
54+
If the application uses other SQLx drivers, enable their offline support too.
55+
5356
Each open connection uses a worker thread for blocking ODBC calls. Dropping a
5457
query stream stops delivery and lets the worker release its cursor before
5558
running the next operation. A native ODBC call already in progress can still

‎src/any.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ impl AnyConnectionBackend for OdbcConnection {
136136
})
137137
}
138138

139+
#[cfg(feature = "offline")]
139140
fn describe(
140141
&mut self,
141142
sql: SqlStr,

‎src/connection.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ impl<'c> ConnectionState<'c> {
427427
})
428428
}
429429

430+
#[cfg(feature = "offline")]
430431
fn describe(&self, sql: &str) -> sqlx_core::Result<sqlx_core::describe::Describe<crate::Odbc>> {
431432
let mut prepared = self.prepare_handle(sql)?;
432433
let parameters = prepared.num_params().map_err(|error| {
@@ -610,6 +611,7 @@ impl<'c> Executor<'c> for &'c mut OdbcConnection {
610611
Box::pin(self.request_async(move |state| state.prepare(sql)))
611612
}
612613

614+
#[cfg(feature = "offline")]
613615
fn describe<'e>(
614616
self,
615617
sql: sqlx_core::sql_str::SqlStr,

‎tests/odbc.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ async fn sqlx_prepare_reports_basic_metadata_when_configured(
913913
Ok(())
914914
}
915915

916+
#[cfg(feature = "offline")]
916917
#[tokio::test]
917918
async fn sqlx_describe_reads_columns_and_propagates_metadata_errors_when_configured(
918919
) -> Result<(), Box<dyn std::error::Error>> {

0 commit comments

Comments
 (0)