@@ -2,16 +2,14 @@ use futures::stream::{self, Stream};
2
2
use futures:: { Async , Future , Poll } ;
3
3
use state_machine_future:: RentToOwn ;
4
4
5
- use bad_response;
6
5
use error:: { Error , SqlState } ;
7
6
use proto:: client:: Client ;
8
7
use proto:: prepare:: PrepareFuture ;
9
8
use proto:: query:: QueryStream ;
10
9
use proto:: typeinfo_composite:: TypeinfoCompositeFuture ;
11
10
use proto:: typeinfo_enum:: TypeinfoEnumFuture ;
12
11
use types:: { Kind , Oid , Type } ;
13
-
14
- const TYPEINFO_NAME : & ' static str = "_rust_typeinfo" ;
12
+ use { bad_response, next_statement} ;
15
13
16
14
const TYPEINFO_QUERY : & ' static str = "
17
15
SELECT t.typname, t.typtype, t.typelem, r.rngsubtype, t.typbasetype, n.nspname, t.typrelid
@@ -125,11 +123,7 @@ impl PollTypeinfo for Typeinfo {
125
123
client: state. client,
126
124
} ) ,
127
125
None => transition ! ( PreparingTypeinfo {
128
- future: Box :: new( state. client. prepare(
129
- TYPEINFO_NAME . to_string( ) ,
130
- TYPEINFO_QUERY ,
131
- & [ ]
132
- ) ) ,
126
+ future: Box :: new( state. client. prepare( next_statement( ) , TYPEINFO_QUERY , & [ ] ) ) ,
133
127
oid: state. oid,
134
128
client: state. client,
135
129
} ) ,
@@ -147,7 +141,7 @@ impl PollTypeinfo for Typeinfo {
147
141
148
142
transition ! ( PreparingTypeinfoFallback {
149
143
future: Box :: new( state. client. prepare(
150
- TYPEINFO_NAME . to_string ( ) ,
144
+ next_statement ( ) ,
151
145
TYPEINFO_FALLBACK_QUERY ,
152
146
& [ ]
153
147
) ) ,
0 commit comments