proxy

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID              string
	Op              Op
	Query           string
	Args            []string
	StartTime       time.Time
	Duration        time.Duration
	RowsAffected    int64
	Error           string
	TxID            string
	NPlus1          bool
	NormalizedQuery string
}

Event represents a captured database query event.

type Op

type Op int32

Op represents the type of database operation captured.

const (
	OpQuery    Op = iota // Simple query or extended-query execute
	OpExec               // Non-query execution
	OpPrepare            // Prepared statement parse
	OpBind               // Parameter binding
	OpExecute            // Extended-protocol execute
	OpBegin              // Transaction begin
	OpCommit             // Transaction commit
	OpRollback           // Transaction rollback
)

func (Op) String

func (o Op) String() string

type Proxy

type Proxy interface {
	// ListenAndServe accepts client connections and relays them to the upstream DB.
	ListenAndServe(ctx context.Context) error
	// Events returns the channel of captured events.
	Events() <-chan Event
	// Close stops the proxy.
	Close() error
}

Proxy is the common interface for DB protocol proxies.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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