pgwire: A library for writing postgresql compatible servers

74 points sunng

pgwire implements postgresql wire protocol and some of the upper mechanisms like various authentications, tls, extended query (aka prepared statement) and etc. It gives you some traits to implement your own postgresql compatible servers (and client if there is case rust-postgres does not fit).

Postgresql wire protocol is actually a general purpose Layer-7 application protocol. It is not bound with SQL, and can be used for any query language, data format or even natural language. It is possible to build a chat bot that use psql as client.

pgwire has been used in databases like greptimedb and libsql for postgres protocol. I just pushed version 0.12, which I think is time to introduce it to wider audience. Help and collaboration is welcomed to validate the API design, improve performance or adding integration tests. Thank you.