Convert real to binary PostgreSQL format
(&self, value: f64, pg_type_oid: i32)
| 270 | |
| 271 | /// Convert real to binary PostgreSQL format |
| 272 | fn convert_real_binary(&self, value: f64, pg_type_oid: i32) -> Vec<u8> { |
| 273 | use crate::protocol::BinaryEncoder; |
| 274 | |
| 275 | match pg_type_oid { |
| 276 | t if t == PgType::Float4.to_oid() => BinaryEncoder::encode_float4(value as f32), // FLOAT4 |
| 277 | t if t == PgType::Float8.to_oid() => BinaryEncoder::encode_float8(value), // FLOAT8 |
| 278 | _ => value.to_string().into_bytes(), // Fallback to text |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | /// Convert JSON array to PostgreSQL text array format |
| 283 | fn convert_json_to_pg_array(&self, json_str: &str) -> io::Result<Vec<u8>> { |
no test coverage detected