File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: connection;
2
2
use diesel:: deserialize:: { self , FromSql , FromSqlRow } ;
3
- use diesel:: expression:: AsExpression ;
3
+ use diesel:: expression:: { AsExpression , IntoSql } ;
4
4
use diesel:: pg:: { Pg , PgValue } ;
5
5
use diesel:: serialize:: { self , IsNull , Output , ToSql } ;
6
6
use diesel:: sql_types:: SqlType ;
@@ -68,6 +68,14 @@ async fn custom_types_round_trip() {
68
68
} ,
69
69
] ;
70
70
let connection = & mut connection ( ) . await ;
71
+
72
+ // Try encoding an array to test type metadata lookup
73
+ let selected = select ( [ MyEnum :: Foo , MyEnum :: Bar ] . into_sql :: < sql_types:: Array < MyType > > ( ) )
74
+ . get_result ( connection)
75
+ . await
76
+ . unwrap ( ) ;
77
+ assert_eq ! ( vec![ MyEnum :: Foo , MyEnum :: Bar ] , selected) ;
78
+
71
79
connection
72
80
. batch_execute (
73
81
r#"
You can’t perform that action at this time.
0 commit comments