sea_query/value/
with_pgvector.rs1use super::*;
2
3impl From<pgvector::Vector> for Value {
4 fn from(x: pgvector::Vector) -> Value {
5 Value::Vector(Some(x))
6 }
7}
8
9impl Nullable for pgvector::Vector {
10 fn null() -> Value {
11 Value::Vector(None)
12 }
13}
14
15impl ValueType for pgvector::Vector {
16 fn try_from(v: Value) -> Result<Self, ValueTypeErr> {
17 match v {
18 Value::Vector(Some(x)) => Ok(x),
19 _ => Err(ValueTypeErr),
20 }
21 }
22
23 fn type_name() -> String {
24 stringify!(Vector).to_owned()
25 }
26
27 fn array_type() -> ArrayType {
28 unimplemented!("Vector does not have array type")
29 }
30
31 fn column_type() -> ColumnType {
32 ColumnType::Vector(None)
33 }
34}