mirror of
				https://github.com/launchbadge/sqlx.git
				synced 2025-11-04 07:22:53 +00:00 
			
		
		
		
	macros: add support for Postgres + BigDecimal
This commit is contained in:
		
							parent
							
								
									703dad8fcf
								
							
						
					
					
						commit
						3cb42def3b
					
				@ -62,6 +62,8 @@ impl PgTypeInfo {
 | 
			
		||||
        match self.id {
 | 
			
		||||
            TypeId::DATE | TypeId::TIME | TypeId::TIMESTAMP | TypeId::TIMESTAMPTZ => Some("chrono"),
 | 
			
		||||
            TypeId::UUID => Some("uuid"),
 | 
			
		||||
            // we can support decoding `PgNumeric` but it's decidedly less useful to the layman
 | 
			
		||||
            TypeId::NUMERIC => Some("bigdecimal"),
 | 
			
		||||
            _ => None,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -25,6 +25,9 @@ impl_database_ext! {
 | 
			
		||||
 | 
			
		||||
        #[cfg(feature = "chrono")]
 | 
			
		||||
        sqlx::types::chrono::DateTime<sqlx::types::chrono::Utc> | sqlx::types::chrono::DateTime<_>,
 | 
			
		||||
 | 
			
		||||
        #[cfg(feature = "bigdecimal")]
 | 
			
		||||
        sqlx::types::BigDecimal
 | 
			
		||||
    },
 | 
			
		||||
    ParamChecking::Strong,
 | 
			
		||||
    feature-types: info => info.type_feature_gate(),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user