add point type
use std::str::from_utf8;
+use geo_types::{Point};
use crate::decode::Decode;
use crate::error::UnexpectedNullError;
@@ -192,6 +193,14 @@ impl<'c> RawValue<'c> for PgValue<'c> {
let t = serde_json::to_value(&r.unwrap());
return Ok(t.unwrap_or(serde_json::Value::Null));
}
+ "POINT" =>{
+ let r: crate::Result<Point<f64>> = Decode::<'_, Postgres>::decode(self.clone());
+ if r.is_err() {
+ return Err(r.err().unwrap());
+ }
+ let t = serde_json::to_value(&r.unwrap());
+ return Ok(t.unwrap_or(serde_json::Value::Null));
+ }
_ => return Err(crate::Error::from(format!("un support database type for:{:?}!", type_string))),
}
