style(rust): format core modules
This commit is contained in:
@@ -176,7 +176,8 @@ impl AppState {
|
||||
PoolKind::Mysql(db::mysql::connect_bare(&url, connect_timeout).await?, MysqlMode::Bare)
|
||||
}
|
||||
DatabaseType::Mysql => {
|
||||
let pool = db::mysql::connect_with_ca_cert(&url, Some(&db_config.ca_cert_path), connect_timeout).await?;
|
||||
let pool =
|
||||
db::mysql::connect_with_ca_cert(&url, Some(&db_config.ca_cert_path), connect_timeout).await?;
|
||||
let mode = detect_ob_oracle_mode(&db_config, &pool).await;
|
||||
PoolKind::Mysql(pool, mode)
|
||||
}
|
||||
|
||||
@@ -928,10 +928,7 @@ pub async fn execute_query_with_schema_and_max_rows(
|
||||
max_rows: Option<usize>,
|
||||
) -> Result<QueryResult, String> {
|
||||
let client = pool.get().await.map_err(|e| e.to_string())?;
|
||||
client
|
||||
.execute(&format!("SET search_path TO {}", pg_quote_ident(schema)), &[])
|
||||
.await
|
||||
.map_err(pg_error_to_string)?;
|
||||
client.execute(&format!("SET search_path TO {}", pg_quote_ident(schema)), &[]).await.map_err(pg_error_to_string)?;
|
||||
|
||||
let result = execute_query_with_max_rows_inner(&client, sql, max_rows).await;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::query::MAX_ROWS;
|
||||
use crate::sql::starts_with_executable_sql_keyword;
|
||||
use crate::types::{ColumnInfo, DatabaseInfo, ForeignKeyInfo, IndexInfo, QueryResult, TableInfo, TriggerInfo};
|
||||
use futures::TryStreamExt;
|
||||
use rust_decimal::Decimal;
|
||||
use std::time::{Duration, Instant};
|
||||
use tiberius::{AuthMethod, Client, ColumnData, Config, FromSql, QueryItem, QueryStream, SqlBrowser};
|
||||
use tokio::net::TcpStream;
|
||||
use tokio_util::compat::{Compat, TokioAsyncWriteCompatExt};
|
||||
use crate::query::MAX_ROWS;
|
||||
use crate::sql::starts_with_executable_sql_keyword;
|
||||
use crate::types::{ColumnInfo, DatabaseInfo, ForeignKeyInfo, IndexInfo, QueryResult, TableInfo, TriggerInfo};
|
||||
|
||||
pub type SqlServerClient = Client<Compat<TcpStream>>;
|
||||
const SIMPLE_QUERY_MODULE_KEYWORDS: &[&str] = &["FUNCTION", "PROC", "PROCEDURE", "TRIGGER", "VIEW"];
|
||||
|
||||
@@ -827,7 +827,9 @@ fn bracket_ipv6(host: &str) -> String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{default_query_timeout_secs, default_ssh_connect_timeout_secs, ConnectionConfig, DatabaseType, ProxyType};
|
||||
use super::{
|
||||
default_query_timeout_secs, default_ssh_connect_timeout_secs, ConnectionConfig, DatabaseType, ProxyType,
|
||||
};
|
||||
use std::str::FromStr;
|
||||
|
||||
fn mysql_config(username: &str, password: &str, database: Option<&str>) -> ConnectionConfig {
|
||||
|
||||
Reference in New Issue
Block a user