Skip to content

Commit 1518155

Browse files
committed
First steps to refactor value converter
1 parent 66450d5 commit 1518155

File tree

15 files changed

+2448
-2236
lines changed

15 files changed

+2448
-2236
lines changed

src/driver/inner_connection.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ use tokio_postgres::{Client, CopyInSink, Row, Statement, ToStatement};
88
use crate::{
99
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
1010
query_result::{PSQLDriverPyQueryResult, PSQLDriverSinglePyQueryResult},
11-
value_converter::{convert_parameters_and_qs, postgres_to_py, PythonDTO, QueryParameter},
11+
value_converter::{
12+
consts::QueryParameter,
13+
funcs::{from_python::convert_parameters_and_qs, to_python::postgres_to_py},
14+
models::dto::PythonDTO,
15+
},
1216
};
1317

1418
#[allow(clippy::module_name_repetitions)]

src/extra_types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ use crate::{
1313
additional_types::{Circle as RustCircle, Line as RustLine},
1414
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
1515
value_converter::{
16-
build_flat_geo_coords, build_geo_coords, build_serde_value,
17-
py_sequence_into_postgres_array, PythonDTO,
16+
funcs::from_python::{
17+
build_flat_geo_coords, build_geo_coords, py_sequence_into_postgres_array,
18+
},
19+
models::{dto::PythonDTO, serde_value::build_serde_value},
1820
},
1921
};
2022

src/query_result.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
use pyo3::{prelude::*, pyclass, pymethods, types::PyDict, Py, PyAny, Python, ToPyObject};
22
use tokio_postgres::Row;
33

4-
use crate::{exceptions::rust_errors::RustPSQLDriverPyResult, value_converter::postgres_to_py};
4+
use crate::{
5+
exceptions::rust_errors::RustPSQLDriverPyResult,
6+
value_converter::funcs::to_python::postgres_to_py,
7+
};
58

69
/// Convert postgres `Row` into Python Dict.
710
///

0 commit comments

Comments
 (0)