https://github.com/stackql/psql-wire
PostgreSQL server wire protocol. Build your own server and start serving connections.
https://github.com/stackql/psql-wire
Last synced: 6 months ago
JSON representation
PostgreSQL server wire protocol. Build your own server and start serving connections.
- Host: GitHub
- URL: https://github.com/stackql/psql-wire
- Owner: stackql
- License: mpl-2.0
- Created: 2022-03-14T10:21:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T10:48:23.000Z (about 2 years ago)
- Last Synced: 2024-05-01T11:44:47.638Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 124 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# PSQL wire protocol 🔌
**Note**: this work is a fork of [jeroenrinzema/psql-wire](https://github.com/jeroenrinzema/psql-wire).
A pure Go [PostgreSQL](https://www.postgresql.org/) server wire protocol implementation.
Build your own PostgreSQL server with 15 lines of code.
This project attempts to make it as straightforward as possible to set-up and configure your own PSQL server.
Feel free to check out the [examples](https://github.com/stackql/psql-wire/tree/main/examples) directory for various ways on how to configure/set-up your own server.
> 🚧 This project does not include a PSQL parser. Please check out other projects such as [auxten/postgresql-parser](https://github.com/auxten/postgresql-parser) to parse PSQL SQL queries.
```go
package main
import (
"context"
"fmt"
wire "github.com/stackql/psql-wire"
)
func main() {
wire.ListenAndServe("127.0.0.1:5432", func(ctx context.Context, query string, writer wire.DataWriter) error {
fmt.Println(query)
return writer.Complete("", "OK")
})
}
```
---
## Contributing
Thank you for your interest in contributing to psql-wire!
Check out the open projects and/or issues and feel free to join any ongoing discussion.
Everyone is welcome to contribute, whether it's in the form of code, documentation, bug reports, feature requests, or anything else. We encourage you to experiment with the project and make contributions to help evolve it to meet your needs!
See the [contributing guide](https://github.com/stackql/psql-wire/blob/main/CONTRIBUTING.md) for more details.
## Acknowledgements
We sincerely and gratefully acknowledge:
- All involved with [the original fork](https://github.com/jeroenrinzema/psql-wire).