Skip to content

Commit e69a383

Browse files
committed
Moved additional_types to value_converter
1 parent 1518155 commit e69a383

File tree

7 files changed

+13
-21
lines changed

7 files changed

+13
-21
lines changed

src/extra_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use pyo3::{
1010
use serde_json::Value;
1111

1212
use crate::{
13-
additional_types::{Circle as RustCircle, Line as RustLine},
1413
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
1514
value_converter::{
15+
additional_types::{Circle as RustCircle, Line as RustLine},
1616
funcs::from_python::{
1717
build_flat_geo_coords, build_geo_coords, py_sequence_into_postgres_array,
1818
},

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pub mod additional_types;
21
pub mod common;
32
pub mod driver;
43
pub mod exceptions;
File renamed without changes.

src/value_converter/funcs/from_python.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,25 @@ use geo_types::{coord, Coord};
44
use itertools::Itertools;
55
use pg_interval::Interval;
66
use postgres_array::{Array, Dimension};
7-
use postgres_types::{Field, FromSql, Kind, Type};
87
use rust_decimal::Decimal;
98
use serde_json::{json, Map, Value};
109
use std::net::IpAddr;
11-
use tokio_postgres::{Column, Row};
1210
use uuid::Uuid;
1311

1412
use pyo3::{
1513
types::{
1614
PyAnyMethods, PyBool, PyBytes, PyDate, PyDateTime, PyDelta, PyDict, PyDictMethods, PyFloat,
17-
PyInt, PyList, PyListMethods, PyMapping, PySequence, PySet, PyString, PyTime, PyTuple,
18-
PyTypeMethods,
15+
PyInt, PyList, PyMapping, PySequence, PySet, PyString, PyTime, PyTuple, PyTypeMethods,
1916
},
20-
Bound, FromPyObject, IntoPy, Py, PyAny, Python, ToPyObject,
17+
Bound, FromPyObject, Py, PyAny, Python,
2118
};
2219

2320
use crate::{
24-
additional_types::{
25-
Circle, Line, RustLineSegment, RustLineString, RustMacAddr6, RustMacAddr8, RustPoint,
26-
RustRect,
27-
},
2821
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
2922
extra_types::{self},
3023
value_converter::{consts::KWARGS_QUERYSTRINGS, models::dto::PythonDTO},
3124
};
3225

33-
use pgvector::Vector as PgVector;
34-
3526
/// Convert single python parameter to `PythonDTO` enum.
3627
///
3728
/// # Errors

src/value_converter/funcs/to_python.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use chrono::{self, DateTime, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime, TimeZone};
2-
use chrono_tz::Tz;
1+
use chrono::{self, DateTime, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime};
32
use pg_interval::Interval;
43
use postgres_array::{Array, Dimension};
54
use postgres_types::{Field, FromSql, Kind, Type};
@@ -14,16 +13,16 @@ use pyo3::{
1413
PyAnyMethods, PyBytes, PyDict, PyDictMethods, PyList, PyListMethods, PySet, PyString,
1514
PyTuple,
1615
},
17-
Bound, FromPyObject, IntoPy, Py, PyAny, Python, ToPyObject,
16+
Bound, IntoPy, Py, PyAny, Python, ToPyObject,
1817
};
1918

2019
use crate::{
21-
additional_types::{
22-
Circle, Line, RustLineSegment, RustLineString, RustMacAddr6, RustMacAddr8, RustPoint,
23-
RustRect,
24-
},
2520
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
2621
value_converter::{
22+
additional_types::{
23+
Circle, Line, RustLineSegment, RustLineString, RustMacAddr6, RustMacAddr8, RustPoint,
24+
RustRect,
25+
},
2726
consts::KWARGS_QUERYSTRINGS,
2827
models::{
2928
decimal::InnerDecimal, interval::InnerInterval, serde_value::InternalSerdeValue,

src/value_converter/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod additional_types;
12
pub mod consts;
23
pub mod funcs;
34
pub mod models;

src/value_converter/models/dto.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ use pyo3::{PyObject, Python, ToPyObject};
1414
use tokio_postgres::types::{to_sql_checked, Type};
1515

1616
use crate::{
17-
additional_types::{Circle, Line, RustLineSegment, RustLineString, RustPoint, RustRect},
1817
exceptions::rust_errors::{RustPSQLDriverError, RustPSQLDriverPyResult},
18+
value_converter::additional_types::{
19+
Circle, Line, RustLineSegment, RustLineString, RustPoint, RustRect,
20+
},
1921
};
2022
use pgvector::Vector as PgVector;
2123
use postgres_array::{array::Array, Dimension};

0 commit comments

Comments
 (0)