mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
parent
9f70910283
commit
897704fab3
@ -77,11 +77,10 @@ async fn column_exists(pool: &Pool, table_name: &str, column_name: &str) -> sqlx
|
|||||||
"SELECT COUNT(*) AS col_count FROM pragma_table_info('{}') WHERE name = '{}'",
|
"SELECT COUNT(*) AS col_count FROM pragma_table_info('{}') WHERE name = '{}'",
|
||||||
table_name, column_name
|
table_name, column_name
|
||||||
);
|
);
|
||||||
Ok(sqlx::query(&query)
|
match sqlx::query(&query).fetch_one(pool).await {
|
||||||
.fetch_one(pool)
|
Err(_) => Ok(false),
|
||||||
.await?
|
Ok(row) => Ok(row.get::<i32, _>("col_count") > 0),
|
||||||
.get::<i32, _>("col_count")
|
}
|
||||||
> 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn create_group(group_name: &str, pool: &Pool) -> sqlx::Result<()> {
|
pub async fn create_group(group_name: &str, pool: &Pool) -> sqlx::Result<()> {
|
||||||
|
Loading…
Reference in New Issue
Block a user