Convert BLOB to PostgreSQL format
(&self, blob_data: &[u8], pg_type_oid: i32, binary_format: bool)
| 242 | |
| 243 | /// Convert BLOB to PostgreSQL format |
| 244 | fn convert_blob_to_pg_format(&self, blob_data: &[u8], pg_type_oid: i32, binary_format: bool) -> Vec<u8> { |
| 245 | if binary_format { |
| 246 | // Binary format - use as-is for BYTEA |
| 247 | blob_data.to_vec() |
| 248 | } else { |
| 249 | // Text format |
| 250 | if pg_type_oid == 17 { // BYTEA |
| 251 | format!("\\x{}", hex::encode(blob_data)).into_bytes() |
| 252 | } else { |
| 253 | blob_data.to_vec() |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | /// Convert integer to binary PostgreSQL format |
| 259 | fn convert_integer_binary(&self, value: i64, pg_type_oid: i32) -> Vec<u8> { |