cargo fix on server

This commit is contained in:
Priec
2025-10-26 16:07:19 +01:00
parent 492f1f1e55
commit 11185282c4
15 changed files with 7 additions and 20 deletions

View File

@@ -1,6 +1,5 @@
// src/server/services/table_validation_service.rs // src/server/services/table_validation_service.rs
use tonic::transport::Server;
use sqlx::PgPool; use sqlx::PgPool;
use common::proto::komp_ac::table_validation::table_validation_service_server::TableValidationServiceServer; use common::proto::komp_ac::table_validation::table_validation_service_server::TableValidationServiceServer;

View File

@@ -2,7 +2,6 @@
use tonic::Status; use tonic::Status;
use sqlx::{PgPool, Transaction, Postgres}; use sqlx::{PgPool, Transaction, Postgres};
use serde_json::json;
use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, TableDefinitionResponse}; use common::proto::komp_ac::table_definition::{PostTableDefinitionRequest, TableDefinitionResponse};
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use crate::table_definition::models::map_field_type; use crate::table_definition::models::map_field_type;

View File

@@ -3,7 +3,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use tonic::Status; use tonic::Status;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{json, Value}; use serde_json::Value;
/// Represents the state of a node during dependency graph traversal. /// Represents the state of a node during dependency graph traversal.
#[derive(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq)]

View File

@@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script; // Fi
use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_script::PostTableScriptRequest;
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use rstest::*; use rstest::*;
use serde_json::json;
use sqlx::PgPool; use sqlx::PgPool;
/// Helper function to create a test table with specified columns /// Helper function to create a test table with specified columns

View File

@@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script; // Fi
use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_script::PostTableScriptRequest;
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use rstest::*; use rstest::*;
use serde_json::json;
use sqlx::PgPool; use sqlx::PgPool;
/// Helper function to create a test table with specified columns /// Helper function to create a test table with specified columns

View File

@@ -4,7 +4,6 @@ use crate::common::setup_isolated_db;
use server::table_script::handlers::post_table_script::post_table_script; use server::table_script::handlers::post_table_script::post_table_script;
use common::proto::komp_ac::table_script::{PostTableScriptRequest, TableScriptResponse}; use common::proto::komp_ac::table_script::{PostTableScriptRequest, TableScriptResponse};
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use serde_json::json;
use sqlx::PgPool; use sqlx::PgPool;
/// Test utilities for table script integration testing - moved to top level for shared access /// Test utilities for table script integration testing - moved to top level for shared access

View File

@@ -4,7 +4,6 @@ use crate::common::setup_isolated_db;
use server::table_script::handlers::post_table_script::post_table_script; use server::table_script::handlers::post_table_script::post_table_script;
use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_script::PostTableScriptRequest;
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use serde_json::json;
use sqlx::PgPool; use sqlx::PgPool;
/// Helper function to create a test table with specified columns /// Helper function to create a test table with specified columns

View File

@@ -5,7 +5,6 @@ use server::table_script::handlers::post_table_script::post_table_script;
use common::proto::komp_ac::table_script::PostTableScriptRequest; use common::proto::komp_ac::table_script::PostTableScriptRequest;
use common::proto::komp_ac::table_definition::ColumnDefinition; use common::proto::komp_ac::table_definition::ColumnDefinition;
use rstest::*; use rstest::*;
use serde_json::json;
use sqlx::PgPool; use sqlx::PgPool;
/// Test fixture for allowed mathematical types /// Test fixture for allowed mathematical types

View File

@@ -5,7 +5,6 @@ use sqlx::{PgPool, Row};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use tokio::sync::{mpsc, Mutex}; use tokio::sync::{mpsc, Mutex};
use serde_json::json;
use chrono::Utc; use chrono::Utc;
use futures::future::join_all; use futures::future::join_all;
use prost_types::{value::Kind, Value}; use prost_types::{value::Kind, Value};
@@ -17,7 +16,7 @@ use common::proto::komp_ac::table_definition::{
PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink, PostTableDefinitionRequest, ColumnDefinition as TableColumnDefinition, TableLink,
}; };
use common::proto::komp_ac::tables_data::{ use common::proto::komp_ac::tables_data::{
DeleteTableDataRequest, DeleteTableDataResponse, PostTableDataRequest, PutTableDataRequest, DeleteTableDataRequest, PostTableDataRequest, PutTableDataRequest,
}; };
use server::indexer::IndexCommand; use server::indexer::IndexCommand;
use server::table_definition::handlers::post_table_definition; use server::table_definition::handlers::post_table_definition;

View File

@@ -8,7 +8,6 @@ use server::table_definition::handlers::post_table_definition;
use server::tables_data::handlers::get_table_data_by_position; use server::tables_data::handlers::get_table_data_by_position;
use crate::common::setup_test_db; use crate::common::setup_test_db;
use chrono::Utc; use chrono::Utc;
use serde_json::json;
#[fixture] #[fixture]
async fn pool() -> PgPool { async fn pool() -> PgPool {

View File

@@ -5,14 +5,12 @@ use common::proto::komp_ac::tables_data::GetTableDataRequest;
use crate::common::setup_test_db; use crate::common::setup_test_db;
use sqlx::{PgPool, Row}; use sqlx::{PgPool, Row};
use tonic; use tonic;
use chrono::{DateTime, Utc}; use chrono::Utc;
use serde_json::json; use serde_json::json;
use std::collections::HashMap; use std::collections::HashMap;
use futures::future::join_all; use futures::future::join_all;
use rand::distr::Alphanumeric; use rand::distr::Alphanumeric;
use rand::Rng; use rand::Rng;
use rust_decimal::Decimal;
use rust_decimal_macros::dec;
use server::table_definition::handlers::post_table_definition; use server::table_definition::handlers::post_table_definition;
use server::tables_data::handlers::post_table_data; use server::tables_data::handlers::post_table_data;
use common::proto::komp_ac::table_definition::{ use common::proto::komp_ac::table_definition::{
@@ -22,7 +20,6 @@ use common::proto::komp_ac::tables_data::PostTableDataRequest;
use prost_types::Value; use prost_types::Value;
use prost_types::value::Kind; use prost_types::value::Kind;
use tokio::sync::mpsc; use tokio::sync::mpsc;
use server::indexer::IndexCommand;
#[fixture] #[fixture]
async fn pool() -> PgPool { async fn pool() -> PgPool {

View File

@@ -795,7 +795,7 @@ async fn test_retrieve_from_nonexistent_schema() {
#[rstest] #[rstest]
#[tokio::test] #[tokio::test]
async fn test_retrieve_with_database_connection_error() { async fn test_retrieve_with_database_connection_error() {
let mut closed_pool = setup_test_db().await; let closed_pool = setup_test_db().await;
closed_pool.close().await; closed_pool.close().await;
let request = GetTableDataRequest { let request = GetTableDataRequest {

View File

@@ -20,7 +20,6 @@ use server::indexer::IndexCommand;
use sqlx::Row; use sqlx::Row;
use rand::distr::Alphanumeric; use rand::distr::Alphanumeric;
use rand::Rng; use rand::Rng;
use rust_decimal::prelude::FromPrimitive;
// Helper function to generate unique identifiers for test isolation // Helper function to generate unique identifiers for test isolation
fn generate_unique_id() -> String { fn generate_unique_id() -> String {
@@ -154,7 +153,7 @@ async fn test_context() -> TestContext {
#[fixture] #[fixture]
async fn closed_test_context() -> TestContext { async fn closed_test_context() -> TestContext {
let mut context = test_context().await; let context = test_context().await;
context.pool.close().await; context.pool.close().await;
context context
} }

View File

@@ -5,7 +5,7 @@
// ======================================================================== // ========================================================================
// Additional imports needed for these tests // Additional imports needed for these tests
use chrono::{DateTime, Utc}; use chrono::Utc;
use rust_decimal::Decimal; use rust_decimal::Decimal;
use std::str::FromStr; use std::str::FromStr;

View File

@@ -8,7 +8,7 @@
// This is needed for the database error test. // This is needed for the database error test.
#[fixture] #[fixture]
async fn closed_test_context() -> TestContext { async fn closed_test_context() -> TestContext {
let mut context = test_context().await; let context = test_context().await;
context.pool.close().await; context.pool.close().await;
context context
} }