MCPcopy Create free account
hub / github.com/erans/pgsqlite / perform_startup

Function perform_startup

tests/benchmark_batch_operations.rs:242–253  ·  view source on GitHub ↗
(stream: &mut TcpStream)

Source from the content-addressed store, hash-verified

240}
241
242async fn perform_startup(stream: &mut TcpStream) {
243 // Send startup message
244 let mut startup = vec![];
245 startup.extend_from_slice(&196608u32.to_be_bytes()); // Protocol version 3.0
246 startup.extend_from_slice(b"user\0test\0database\0test\0\0");
247 let len = ((startup.len() + 4) as u32).to_be_bytes();
248 stream.write_all(&len).await.unwrap();
249 stream.write_all(&startup).await.unwrap();
250
251 // Read until ReadyForQuery
252 read_until_ready(stream).await;
253}
254
255async fn send_query(stream: &mut TcpStream, query: &str) {
256 let mut msg = vec![b'Q'];

Callers 1

Calls 2

read_until_readyFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected