pgwire

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package pgwire implements the PostgreSQL v3 wire protocol frontend. This allows psql, JDBC, ODBC, and any Postgres-compatible client to connect to Wadjet and execute SQL queries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr             string         // listen address, e.g. ":5433"
	TLSConfig        *tls.Config    // nil = plain TCP
	MaxConnections   int            // 0 = unlimited
	MaxConcurrentQry int            // 0 = unlimited concurrent queries
	QueryTimeout     time.Duration  // 0 = no timeout
	AuthProvider     *auth.Provider // nil = no auth enforcement
}

Config holds configuration for the pgwire server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server listens for PostgreSQL wire protocol connections and dispatches queries to a Wadjet DB instance.

func NewServer

func NewServer(db *wadjet.DB, cfg Config, logger *slog.Logger) *Server

NewServer creates a new PostgreSQL wire protocol server.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the listener's address (useful when using :0 for tests).

func (*Server) QueuedQueries

func (s *Server) QueuedQueries() int64

QueuedQueries returns the number of queries waiting for admission.

func (*Server) SetCoordinator

func (s *Server) SetCoordinator(coord *coordinator.Coordinator)

SetCoordinator attaches a coordinator so SELECT statements stream through coord.ExecuteSQL (native-DAG executor with batched output) instead of the legacy wadjet.DB.Query path which materializes all rows into a single CollectSink — root cause of the 2026-04-25 Q18 SF10 OOM.

When unset, all paths fall back to db.Query (current behavior; safe for any caller that hasn't migrated). When set, only SELECT queries route through coord; DDL / DESCRIBE / introspection stay on db.Query for now.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown gracefully stops the server.

func (*Server) Start

func (s *Server) Start(addr string) error

Start begins listening for connections on the given address.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL