Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroenrinzema/psql-wire
PostgreSQL server wire protocol. Build your own server and start serving connections.
https://github.com/jeroenrinzema/psql-wire
go postgres postgresql server sql wire-protocol
Last synced: 17 days ago
JSON representation
PostgreSQL server wire protocol. Build your own server and start serving connections.
- Host: GitHub
- URL: https://github.com/jeroenrinzema/psql-wire
- Owner: jeroenrinzema
- License: mpl-2.0
- Created: 2021-09-10T11:15:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-16T11:27:52.000Z (about 1 month ago)
- Last Synced: 2024-12-16T12:27:52.167Z (about 1 month ago)
- Topics: go, postgres, postgresql, server, sql, wire-protocol
- Language: Go
- Homepage:
- Size: 352 KB
- Stars: 112
- Watchers: 2
- Forks: 20
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - psql-wire (⭐98) - PostgreSQL server wire protocol. Build your own server and start serving connections.. (Recently Updated / [Sep 15, 2024](/content/2024/09/15/README.md))
README
# PSQL wire protocol 🔌
[![CI](https://github.com/jeroenrinzema/psql-wire/actions/workflows/ci.yaml/badge.svg)](https://github.com/jeroenrinzema/psql-wire/actions/workflows/ci.yaml)
[![Go Reference](https://pkg.go.dev/badge/github.com/jeroenrinzema/psql-wire.svg)](https://pkg.go.dev/github.com/jeroenrinzema/psql-wire) [![Latest release](https://img.shields.io/github/release/jeroenrinzema/psql-wire.svg)](https://github.com/jeroenrinzema/psql-wire/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/jeroenrinzema/psql-wire)](https://goreportcard.com/report/github.com/jeroenrinzema/psql-wire)A pure Go [PostgreSQL](https://www.postgresql.org/) server wire protocol implementation.
Build your own PostgreSQL server within a few lines of code.
This project attempts to make it as straight forward as possible to set-up and configure your own PSQL server.
Feel free to check out the [examples](https://github.com/jeroenrinzema/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 mainimport (
"context"
"fmt"wire "github.com/jeroenrinzema/psql-wire"
)func main() {
wire.ListenAndServe("127.0.0.1:5432", handler)
}func handler(ctx context.Context, query string) (wire.PreparedStatements, error) {
return wire.Prepared(wire.NewStatement(func(ctx context.Context, writer wire.DataWriter, parameters []wire.Parameter) error {
fmt.Println(query)
return writer.Complete("OK")
})), nil
}
```---
> 🚧 When wanting to debug issues and or inspect the PostgreSQL wire protocol please check out the [psql-proxy](https://github.com/cloudproud/psql-proxy) cli
## Support
Feel free to start a new discussion to discuss feature requests or issues.
## 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.
Feel free to checkout the [open TODO's](https://github.com/jeroenrinzema/psql-wire/issues?q=is%3Aissue+is%3Aopen+label%3Atodo) within the project.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/jeroenrinzema/psql-wire/blob/main/CONTRIBUTING.md) for more details.