Skip to content

Commit

Permalink
Update broker.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjm918 authored Jun 5, 2024
1 parent fd9a845 commit 2059f4c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,14 @@ impl Broker {

pub async fn definitions(&mut self) -> Result<()> {
self.definition.clear();
let sql = r#"
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'IV' ORDER BY ORDINAL_POSITION;
"#;
let sql = format!(
r#"
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = '{}' ORDER BY ORDINAL_POSITION;
"#,
self.table
);
let client = self.pool.client().await;
let mut conn = client.expect("Mssql Connection is closed");
let stream = conn.simple_query(sql).await?;
Expand Down

0 comments on commit 2059f4c

Please sign in to comment.