{"size": 1047, "ext": "js", "max_stars_repo_path": "message-formats.js", "max_stars_repo_name": "byrney/node-pg-copy-streams", "max_stars_repo_stars_event_min_datetime": "2015-01-10T16:04:53.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T00:33:29.000Z", "max_issues_repo_path": "message-formats.js", "max_issues_repo_name": "byrney/node-pg-copy-streams", "max_issues_repo_issues_event_min_datetime": "2015-01-20T21:55:01.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-28T09:37:56.000Z", "max_forks_repo_path": "message-formats.js", "max_forks_repo_name": "byrney/node-pg-copy-streams", "max_forks_repo_forks_event_min_datetime": "2015-04-27T23:13:49.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-15T09:25:29.000Z"}
{"max_stars_count": 254, "max_issues_count": 102, "max_forks_count": 42, "avg_line_length": 37.3928571429, "max_line_length": 113, "alphanum_fraction": 0.7268385864}
/**
 * The COPY feature uses the following protocol codes.
 * The codes for the most recent protocol version are documented on
 * https://www.postgresql.org/docs/current/static/protocol-message-formats.html
 *
 * The protocol flow itself is described on
 * https://www.postgresql.org/docs/current/static/protocol-flow.html
 */
module.exports = {
  ErrorResponse: 0x45, // E
  CopyInResponse: 0x47, // G
  CopyOutResponse: 0x48, // H
  CopyBothResponse: 0x57, // W
  CopyDone: 0x63, // c
  CopyData: 0x64, // d
  CopyFail: 0x66, // f
  CommandComplete: 0x43, // C
  ReadyForQuery: 0x5a, // Z

  // It is possible for NoticeResponse and ParameterStatus messages to be interspersed between CopyData messages;
  // frontends must handle these cases, and should be prepared for other asynchronous message types as well
  // (see Section 50.2.6).
  // Otherwise, any message type other than CopyData or CopyDone may be treated as terminating copy-out mode.
  NotificationResponse: 0x41, // A
  NoticeResponse: 0x4e, // N
  ParameterStatus: 0x53, // S
}
