MCPcopy Create free account
hub / github.com/erans/pgsqlite / convert_blob_to_pg_format

Method convert_blob_to_pg_format

src/protocol/value_handler.rs:244–256  ·  view source on GitHub ↗

Convert BLOB to PostgreSQL format

(&self, blob_data: &[u8], pg_type_oid: i32, binary_format: bool)

Source from the content-addressed store, hash-verified

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> {

Callers 1

handle_blob_valueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected