//! SQLx trait implementation tests for identifier types //! Temporarily disabled due to incomplete SQLx trait implementations // TODO: Re-enable once SQLx traits are properly implemented for all types /* #[cfg(all(test, feature = "database"))] mod tests { use crate::types::*; use sqlx::{Postgres, TypeInfo}; /// Test OrderId SQLx serialization/deserialization #[test] fn test_order_id_sqlx() { let order_id = OrderId::new(); // Test that OrderId can be used in SQLx queries (compile-time check) let type_info = >::type_info(); let _: bool = sqlx::types::Type::::compatible(&type_info); } /// Test TradeId SQLx serialization/deserialization #[test] fn test_trade_id_sqlx() -> Result<(), Box> { let trade_id = TradeId::new("TRADE-001")?; // Test that TradeId can be used in SQLx queries (compile-time check) let type_info = >::type_info(); let _: bool = sqlx::types::Type::::compatible(&type_info); Ok(()) } /// Test Symbol SQLx serialization/deserialization #[test] fn test_symbol_sqlx() -> Result<(), Box> { let symbol = Symbol::new_validated("AAPL".to_string())?; // Test that Symbol can be used in SQLx queries (compile-time check) let type_info = >::type_info(); let _: bool = sqlx::types::Type::::compatible(&type_info); Ok(()) } /// Test AccountId SQLx serialization/deserialization #[test] fn test_account_id_sqlx() -> Result<(), Box> { let account_id = AccountId::new("ACC-001")?; // Test that AccountId can be used in SQLx queries (compile-time check) let type_info = >::type_info(); let _: bool = sqlx::types::Type::::compatible(&type_info); Ok(()) } /// Test OrderSide SQLx serialization/deserialization #[test] fn test_order_side_sqlx() { let buy_side = OrderSide::Buy; let sell_side = OrderSide::Sell; // Test that OrderSide can be used in SQLx queries (compile-time check) let type_info = >::type_info(); let _: bool = sqlx::types::Type::::compatible(&type_info); } /// Test that transparent newtypes work with underlying PostgreSQL types #[test] fn test_transparent_type_mapping() { // OrderId should map to BIGINT (i64/u64) assert_eq!( >::type_info().name(), "BIGINT" ); // String-based types should map to TEXT assert_eq!( >::type_info().name(), "TEXT" ); assert_eq!( >::type_info().name(), "TEXT" ); // OrderSide should map to TEXT assert_eq!( >::type_info().name(), "TEXT" ); } } */