(&mut self)
| 1380 | } |
| 1381 | |
| 1382 | fn start_protocol(&mut self) -> Result<()> { |
| 1383 | if self.started { |
| 1384 | return Ok(()); |
| 1385 | } |
| 1386 | let startup = startup_packet(&self.startup_config.username, &self.startup_config.database); |
| 1387 | let response = self.start_protocol_with_startup_packet(&startup)?; |
| 1388 | ensure!( |
| 1389 | response.accepted, |
| 1390 | "PGlite WASIX startup packet was rejected: {}", |
| 1391 | summarize_protocol(&response.output) |
| 1392 | ); |
| 1393 | ensure!( |
| 1394 | !protocol_response_contains_error(&response.output), |
| 1395 | "PGlite WASIX startup packet returned an error: {}", |
| 1396 | summarize_protocol(&response.output) |
| 1397 | ); |
| 1398 | Ok(()) |
| 1399 | } |
| 1400 | |
| 1401 | pub(crate) fn start_protocol_with_startup_packet( |
| 1402 | &mut self, |
no test coverage detected