Skip to content

Commit 8ddde2a

Browse files
committed
odbc: describe prepared statements
1 parent b0d94e9 commit 8ddde2a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,19 @@ impl<'c> Executor<'c> for &'c mut OdbcConnection {
5252
}
5353

5454
#[doc(hidden)]
55-
fn describe<'e, 'q: 'e>(self, _sql: &'q str) -> BoxFuture<'e, Result<Describe<Odbc>, Error>>
55+
fn describe<'e, 'q: 'e>(self, sql: &'q str) -> BoxFuture<'e, Result<Describe<Odbc>, Error>>
5656
where
5757
'c: 'e,
5858
{
59-
Box::pin(async move { Err(Error::Protocol("ODBC describe not implemented".into())) })
59+
Box::pin(async move {
60+
let statement = self.prepare(sql).await?;
61+
let nullable = vec![None; statement.metadata.columns.len()];
62+
63+
Ok(Describe {
64+
columns: statement.metadata.columns,
65+
parameters: Some(Either::Right(statement.metadata.parameters)),
66+
nullable,
67+
})
68+
})
6069
}
6170
}

0 commit comments

Comments
 (0)