@@ -26,6 +26,7 @@ const DISCARD_ALL = 0x2F; // 0010 1111 // DISCARD_ALL - unused
26
26
const PULL_ALL = 0x3F ; // 0011 1111 // PULL_ALL
27
27
28
28
const HELLO = 0x01 ; // 0000 0001 // HELLO <metadata>
29
+ const GOODBYE = 0x02 ; // 0000 0010 // GOODBYE
29
30
const BEGIN = 0x11 ; // 0001 0001 // BEGIN <metadata>
30
31
const COMMIT = 0x12 ; // 0001 0010 // COMMIT
31
32
const ROLLBACK = 0x13 ; // 0001 0011 // ROLLBACK
@@ -125,6 +126,14 @@ export default class RequestMessage {
125
126
return new RequestMessage ( RUN , [ statement , parameters , metadata ] ,
126
127
( ) => `RUN ${ statement } ${ JSON . stringify ( parameters ) } ${ JSON . stringify ( metadata ) } ` ) ;
127
128
}
129
+
130
+ /**
131
+ * Get a GOODBYE message.
132
+ * @return {RequestMessage } the GOODBYE message.
133
+ */
134
+ static goodbye ( ) {
135
+ return GOODBYE_MESSAGE ;
136
+ }
128
137
}
129
138
130
139
/**
@@ -152,3 +161,4 @@ const PULL_ALL_MESSAGE = new RequestMessage(PULL_ALL, [], () => 'PULL_ALL');
152
161
const RESET_MESSAGE = new RequestMessage ( RESET , [ ] , ( ) => 'RESET' ) ;
153
162
const COMMIT_MESSAGE = new RequestMessage ( COMMIT , [ ] , ( ) => 'COMMIT' ) ;
154
163
const ROLLBACK_MESSAGE = new RequestMessage ( ROLLBACK , [ ] , ( ) => 'ROLLBACK' ) ;
164
+ const GOODBYE_MESSAGE = new RequestMessage ( GOODBYE , [ ] , ( ) => 'GOODBYE' ) ;
0 commit comments