Skip to content

Commit a3dfb26

Browse files
committed
Started adding expicit array types
Signed-off-by: chandr-andr (Kiselev Aleksandr) <chandr@chandr.net>
1 parent 1d815f7 commit a3dfb26

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

src/value_converter.rs

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
893893
let binding = parameter.extract::<BoolArray>()?.inner();
894894
let bound_inner =
895895
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
896-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyBoolArray(
896+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyBoolArray(
897897
py_sequence_into_postgres_array(bound_inner)?,
898-
));
898+
))
899899
});
900900
}
901901

@@ -904,9 +904,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
904904
let binding = parameter.extract::<UUIDArray>()?.inner();
905905
let bound_inner =
906906
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
907-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyUuidArray(
907+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyUuidArray(
908908
py_sequence_into_postgres_array(bound_inner)?,
909-
));
909+
))
910910
});
911911
}
912912

@@ -915,9 +915,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
915915
let binding = parameter.extract::<VarCharArray>()?.inner();
916916
let bound_inner =
917917
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
918-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyVarCharArray(
918+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyVarCharArray(
919919
py_sequence_into_postgres_array(bound_inner)?,
920-
));
920+
))
921921
});
922922
}
923923

@@ -926,9 +926,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
926926
let binding = parameter.extract::<TextArray>()?.inner();
927927
let bound_inner =
928928
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
929-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyTextArray(
929+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyTextArray(
930930
py_sequence_into_postgres_array(bound_inner)?,
931-
));
931+
))
932932
});
933933
}
934934

@@ -937,9 +937,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
937937
let binding = parameter.extract::<Int16Array>()?.inner();
938938
let bound_inner =
939939
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
940-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt16Array(
940+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt16Array(
941941
py_sequence_into_postgres_array(bound_inner)?,
942-
));
942+
))
943943
});
944944
}
945945

@@ -948,9 +948,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
948948
let binding = parameter.extract::<Int32Array>()?.inner();
949949
let bound_inner =
950950
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
951-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt32Array(
951+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt32Array(
952952
py_sequence_into_postgres_array(bound_inner)?,
953-
));
953+
))
954954
});
955955
}
956956

@@ -959,9 +959,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
959959
let binding = parameter.extract::<Int64Array>()?.inner();
960960
let bound_inner =
961961
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
962-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt64Array(
962+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyInt64Array(
963963
py_sequence_into_postgres_array(bound_inner)?,
964-
));
964+
))
965965
});
966966
}
967967

@@ -970,9 +970,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
970970
let binding = parameter.extract::<Flaot32Array>()?.inner();
971971
let bound_inner =
972972
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
973-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyFlaot32Array(
973+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyFlaot32Array(
974974
py_sequence_into_postgres_array(bound_inner)?,
975-
));
975+
))
976976
});
977977
}
978978

@@ -981,9 +981,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
981981
let binding = parameter.extract::<Flaot64Array>()?.inner();
982982
let bound_inner =
983983
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
984-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyFlaot64Array(
984+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyFlaot64Array(
985985
py_sequence_into_postgres_array(bound_inner)?,
986-
));
986+
))
987987
});
988988
}
989989

@@ -992,9 +992,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
992992
let binding = parameter.extract::<MoneyArray>()?.inner();
993993
let bound_inner =
994994
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
995-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMoneyArray(
995+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMoneyArray(
996996
py_sequence_into_postgres_array(bound_inner)?,
997-
));
997+
))
998998
});
999999
}
10001000

@@ -1003,9 +1003,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10031003
let binding = parameter.extract::<IpAddressArray>()?.inner();
10041004
let bound_inner =
10051005
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1006-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyIpAddressArray(
1006+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyIpAddressArray(
10071007
py_sequence_into_postgres_array(bound_inner)?,
1008-
));
1008+
))
10091009
});
10101010
}
10111011

@@ -1014,9 +1014,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10141014
let binding = parameter.extract::<JSONBArray>()?.inner();
10151015
let bound_inner =
10161016
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1017-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyJSONBArray(
1017+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyJSONBArray(
10181018
py_sequence_into_postgres_array(bound_inner)?,
1019-
));
1019+
))
10201020
});
10211021
}
10221022

@@ -1025,9 +1025,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10251025
let binding = parameter.extract::<JSONArray>()?.inner();
10261026
let bound_inner =
10271027
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1028-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyJSONArray(
1028+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyJSONArray(
10291029
py_sequence_into_postgres_array(bound_inner)?,
1030-
));
1030+
))
10311031
});
10321032
}
10331033

@@ -1036,9 +1036,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10361036
let binding = parameter.extract::<DateArray>()?.inner();
10371037
let bound_inner =
10381038
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1039-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateArray(
1039+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateArray(
10401040
py_sequence_into_postgres_array(bound_inner)?,
1041-
));
1041+
))
10421042
});
10431043
}
10441044

@@ -1047,9 +1047,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10471047
let binding = parameter.extract::<TimeArray>()?.inner();
10481048
let bound_inner =
10491049
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1050-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyTimeArray(
1050+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyTimeArray(
10511051
py_sequence_into_postgres_array(bound_inner)?,
1052-
));
1052+
))
10531053
});
10541054
}
10551055

@@ -1058,9 +1058,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10581058
let binding = parameter.extract::<DateTimeArray>()?.inner();
10591059
let bound_inner =
10601060
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1061-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateTimeArray(
1061+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateTimeArray(
10621062
py_sequence_into_postgres_array(bound_inner)?,
1063-
));
1063+
))
10641064
});
10651065
}
10661066

@@ -1069,9 +1069,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10691069
let binding = parameter.extract::<DateTimeTZArray>()?.inner();
10701070
let bound_inner =
10711071
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1072-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateTimeTZArray(
1072+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyDateTimeTZArray(
10731073
py_sequence_into_postgres_array(bound_inner)?,
1074-
));
1074+
))
10751075
});
10761076
}
10771077

@@ -1080,9 +1080,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10801080
let binding = parameter.extract::<MacAddr6Array>()?.inner();
10811081
let bound_inner =
10821082
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1083-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMacAddr6Array(
1083+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMacAddr6Array(
10841084
py_sequence_into_postgres_array(bound_inner)?,
1085-
));
1085+
))
10861086
});
10871087
}
10881088

@@ -1091,9 +1091,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
10911091
let binding = parameter.extract::<MacAddr8Array>()?.inner();
10921092
let bound_inner =
10931093
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1094-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMacAddr8Array(
1094+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyMacAddr8Array(
10951095
py_sequence_into_postgres_array(bound_inner)?,
1096-
));
1096+
))
10971097
});
10981098
}
10991099

@@ -1102,9 +1102,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11021102
let binding = parameter.extract::<NumericArray>()?.inner();
11031103
let bound_inner =
11041104
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1105-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyNumericArray(
1105+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyNumericArray(
11061106
py_sequence_into_postgres_array(bound_inner)?,
1107-
));
1107+
))
11081108
});
11091109
}
11101110

@@ -1113,9 +1113,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11131113
let binding = parameter.extract::<PointArray>()?.inner();
11141114
let bound_inner =
11151115
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1116-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyPointArray(
1116+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyPointArray(
11171117
py_sequence_into_postgres_array(bound_inner)?,
1118-
));
1118+
))
11191119
});
11201120
}
11211121

@@ -1124,9 +1124,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11241124
let binding = parameter.extract::<BoxArray>()?.inner();
11251125
let bound_inner =
11261126
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1127-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyBoxArray(
1127+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyBoxArray(
11281128
py_sequence_into_postgres_array(bound_inner)?,
1129-
));
1129+
))
11301130
});
11311131
}
11321132

@@ -1135,9 +1135,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11351135
let binding = parameter.extract::<PathArray>()?.inner();
11361136
let bound_inner =
11371137
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1138-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyPathArray(
1138+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyPathArray(
11391139
py_sequence_into_postgres_array(bound_inner)?,
1140-
));
1140+
))
11411141
});
11421142
}
11431143

@@ -1146,9 +1146,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11461146
let binding = parameter.extract::<LineArray>()?.inner();
11471147
let bound_inner =
11481148
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1149-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyLineArray(
1149+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyLineArray(
11501150
py_sequence_into_postgres_array(bound_inner)?,
1151-
));
1151+
))
11521152
});
11531153
}
11541154

@@ -1157,9 +1157,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11571157
let binding = parameter.extract::<LsegArray>()?.inner();
11581158
let bound_inner =
11591159
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1160-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyLsegArray(
1160+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyLsegArray(
11611161
py_sequence_into_postgres_array(bound_inner)?,
1162-
));
1162+
))
11631163
});
11641164
}
11651165

@@ -1168,9 +1168,9 @@ pub fn py_to_rust(parameter: &pyo3::Bound<'_, PyAny>) -> RustPSQLDriverPyResult<
11681168
let binding = parameter.extract::<CircleArray>()?.inner();
11691169
let bound_inner =
11701170
Ok::<&pyo3::Bound<'_, pyo3::PyAny>, RustPSQLDriverError>(binding.bind(gil))?;
1171-
return Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyCircleArray(
1171+
Ok::<PythonDTO, RustPSQLDriverError>(PythonDTO::PyCircleArray(
11721172
py_sequence_into_postgres_array(bound_inner)?,
1173-
));
1173+
))
11741174
});
11751175
}
11761176

0 commit comments

Comments
 (0)