Skip to content

kbth/PostgresMessageSerializer

Repository files navigation

PostgresMessageSerializer

.NET Core

This library allows you to (de-)serialize bytes of PostgreSQL protocol messages.

Usage

Serializing

var message = new QueryMessage();
message.Query = "SELECT * FROM table1";

var bytes = serializer.Serialize(message); // Byte sequence conforming to PostgreSQL protocol

Deserializing

var bytes = new [] { (byte)'Z', (byte)'I' };

var message = serializer.Deserialize(bytes); // PostgreSQL message (ReadyForQueryMessage)

There is also a Deserialize method that takes a stream as argument.

Support

For PoC purposes only, this supports only simple queries, extended queries, and messages used around them. This does not support replication or copying.

About

PoC of PostgreSQL message protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages