File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1488,3 +1488,21 @@ fn explicit_types() {
1488
1488
. unwrap ( ) ;
1489
1489
assert_eq ! ( stmt. param_types( ) [ 0 ] , Type :: INT8 ) ;
1490
1490
}
1491
+
1492
+ #[ test]
1493
+ fn simple_query ( ) {
1494
+ let conn = Connection :: connect ( "postgres://postgres@localhost:5433" , TlsMode :: None ) . unwrap ( ) ;
1495
+ conn. batch_execute (
1496
+ "
1497
+ CREATE TEMPORARY TABLE foo (id INT PRIMARY KEY);
1498
+ INSERT INTO foo (id) VALUES (1), (2), (3);
1499
+ " ,
1500
+ ) . unwrap ( ) ;
1501
+ let queries = "SELECT id FROM foo WHERE id = 1 ORDER BY id; \
1502
+ SELECT id FROM foo WHERE id != 1 ORDER BY id";
1503
+
1504
+ let results = conn. simple_query ( queries) . unwrap ( ) ;
1505
+ assert_eq ! ( results[ 0 ] . get( 0 ) . get( "id" ) , "1" ) ;
1506
+ assert_eq ! ( results[ 1 ] . get( 0 ) . get( "id" ) , "2" ) ;
1507
+ assert_eq ! ( results[ 1 ] . get( 1 ) . get( "id" ) , "3" ) ;
1508
+ }
You can’t perform that action at this time.
0 commit comments