MCPcopy Index your code
hub / github.com/electric-sql/pglite / startup

Function startup

packages/pg-protocol/src/serializer.ts:24–39  ·  view source on GitHub ↗
(opts: Record<string, string>)

Source from the content-addressed store, hash-verified

22const writer = new Writer()
23
24const startup = (opts: Record<string, string>): Uint8Array => {
25 // protocol version
26 writer.addInt16(3).addInt16(0)
27 for (const key of Object.keys(opts)) {
28 writer.addCString(key).addCString(opts[key])
29 }
30
31 writer.addCString('client_encoding').addCString('UTF8')
32
33 const bodyBuffer = writer.addCString('').flush()
34 // this message is sent without a code
35
36 const length = bodyBuffer.byteLength + 4
37
38 return new Writer().addInt32(length).add(bodyBuffer).flush()
39}
40
41const requestSsl = (): Uint8Array => {
42 const bufferView = new DataView(new ArrayBuffer(8))

Callers

nothing calls this directly

Calls 5

flushMethod · 0.65
addInt16Method · 0.45
addCStringMethod · 0.45
addMethod · 0.45
addInt32Method · 0.45

Tested by

no test coverage detected