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

Method convert_value

src/protocol/value_handler.rs:59–84  ·  view source on GitHub ↗

Convert a SQLite value to a PostgreSQL-encoded value with memory mapping optimization

(
        &self,
        value: &SqliteValue,
        pg_type_oid: i32,
        binary_format: bool,
    )

Source from the content-addressed store, hash-verified

57
58 /// Convert a SQLite value to a PostgreSQL-encoded value with memory mapping optimization
59 pub fn convert_value(
60 &self,
61 value: &SqliteValue,
62 pg_type_oid: i32,
63 binary_format: bool,
64 ) -> io::Result<Option<MappedValue>> {
65 match value {
66 SqliteValue::Null => Ok(None),
67
68 SqliteValue::Blob(blob_data) => {
69 self.handle_blob_value(blob_data, pg_type_oid, binary_format)
70 }
71
72 SqliteValue::Text(text_data) => {
73 self.handle_text_value(text_data, pg_type_oid, binary_format)
74 }
75
76 SqliteValue::Integer(int_val) => {
77 self.handle_integer_value(*int_val, pg_type_oid, binary_format)
78 }
79
80 SqliteValue::Real(real_val) => {
81 self.handle_real_value(*real_val, pg_type_oid, binary_format)
82 }
83 }
84 }
85
86 /// Handle BLOB values with potential memory mapping
87 fn handle_blob_value(

Callers 7

convert_rowMethod · 0.45
test_small_blob_handlingFunction · 0.45
test_text_value_handlingFunction · 0.45
test_null_value_handlingFunction · 0.45
test_mmap_enabled_configFunction · 0.45

Calls 4

handle_blob_valueMethod · 0.80
handle_text_valueMethod · 0.80
handle_integer_valueMethod · 0.80
handle_real_valueMethod · 0.80

Tested by 6

test_small_blob_handlingFunction · 0.36
test_text_value_handlingFunction · 0.36
test_null_value_handlingFunction · 0.36
test_mmap_enabled_configFunction · 0.36