@@ -32,10 +32,19 @@ pub enum BackendMessage {
3232 CommandComplete {
3333 tag : String ,
3434 } ,
35+ // FIXME naming
36+ BCopyData {
37+ data : Vec < u8 > ,
38+ } ,
39+ BCopyDone ,
3540 CopyInResponse {
3641 format : u8 ,
3742 column_formats : Vec < u16 > ,
3843 } ,
44+ CopyOutResponse {
45+ format : u8 ,
46+ column_formats : Vec < u16 > ,
47+ } ,
3948 DataRow {
4049 row : Vec < Option < Vec < u8 > > >
4150 } ,
@@ -292,7 +301,15 @@ impl<R: BufRead> ReadMessage for R {
292301 channel : try!( rdr. read_cstr ( ) ) ,
293302 payload : try!( rdr. read_cstr ( ) )
294303 } ,
304+ b'c' => BCopyDone ,
295305 b'C' => CommandComplete { tag : try!( rdr. read_cstr ( ) ) } ,
306+ b'd' => {
307+ let mut data = vec ! [ ] ;
308+ try!( rdr. read_to_end ( & mut data) ) ;
309+ BCopyData {
310+ data : data,
311+ }
312+ }
296313 b'D' => try!( read_data_row ( & mut rdr) ) ,
297314 b'E' => ErrorResponse { fields : try!( read_fields ( & mut rdr) ) } ,
298315 b'G' => {
@@ -306,6 +323,17 @@ impl<R: BufRead> ReadMessage for R {
306323 column_formats : column_formats,
307324 }
308325 }
326+ b'H' => {
327+ let format = try!( rdr. read_u8 ( ) ) ;
328+ let mut column_formats = vec ! [ ] ;
329+ for _ in 0 ..try!( rdr. read_u16 :: < BigEndian > ( ) ) {
330+ column_formats. push ( try!( rdr. read_u16 :: < BigEndian > ( ) ) ) ;
331+ }
332+ CopyOutResponse {
333+ format : format,
334+ column_formats : column_formats,
335+ }
336+ }
309337 b'I' => EmptyQueryResponse ,
310338 b'K' => BackendKeyData {
311339 process_id : try!( rdr. read_u32 :: < BigEndian > ( ) ) ,
0 commit comments