Convert a SQLite value to a PostgreSQL-encoded value with memory mapping optimization
(
&self,
value: &SqliteValue,
pg_type_oid: i32,
binary_format: bool,
)
| 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( |