@@ -26,6 +26,7 @@ const DISCARD_ALL = 0x2F; // 0010 1111 // DISCARD_ALL - unused
2626const PULL_ALL = 0x3F ; // 0011 1111 // PULL_ALL
2727
2828const HELLO = 0x01 ; // 0000 0001 // HELLO <metadata>
29+ const GOODBYE = 0x02 ; // 0000 0010 // GOODBYE
2930const BEGIN = 0x11 ; // 0001 0001 // BEGIN <metadata>
3031const COMMIT = 0x12 ; // 0001 0010 // COMMIT
3132const ROLLBACK = 0x13 ; // 0001 0011 // ROLLBACK
@@ -125,6 +126,14 @@ export default class RequestMessage {
125126 return new RequestMessage ( RUN , [ statement , parameters , metadata ] ,
126127 ( ) => `RUN ${ statement } ${ JSON . stringify ( parameters ) } ${ JSON . stringify ( metadata ) } ` ) ;
127128 }
129+
130+ /**
131+ * Get a GOODBYE message.
132+ * @return {RequestMessage } the GOODBYE message.
133+ */
134+ static goodbye ( ) {
135+ return GOODBYE_MESSAGE ;
136+ }
128137}
129138
130139/**
@@ -152,3 +161,4 @@ const PULL_ALL_MESSAGE = new RequestMessage(PULL_ALL, [], () => 'PULL_ALL');
152161const RESET_MESSAGE = new RequestMessage ( RESET , [ ] , ( ) => 'RESET' ) ;
153162const COMMIT_MESSAGE = new RequestMessage ( COMMIT , [ ] , ( ) => 'COMMIT' ) ;
154163const ROLLBACK_MESSAGE = new RequestMessage ( ROLLBACK , [ ] , ( ) => 'ROLLBACK' ) ;
164+ const GOODBYE_MESSAGE = new RequestMessage ( GOODBYE , [ ] , ( ) => 'GOODBYE' ) ;
0 commit comments