proxy

package
v0.0.0-...-efc2e5e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(sql string) string

Check inspects a SQL string and returns an error message if it uses a DSQL-unsupported feature, or "" if the statement is allowed.

func Rewrite

func Rewrite(sql string) string

Rewrite converts DSQL-specific SQL to PostgreSQL-compatible SQL. CREATE [UNIQUE] INDEX ASYNC → CREATE [UNIQUE] INDEX CONCURRENTLY.

func Run

func Run(ctx context.Context, in RunInput) error

Run starts the DSQL-filtering proxy server.

Types

type BypassConfig

type BypassConfig struct {
	User     string
	Password string
	Database string
}

BypassConfig holds credentials for auth bypass mode. When set, the proxy accepts any client auth and connects to the backend using these credentials instead of relaying auth from the client.

type RunInput

type RunInput struct {
	ListenAddr   string `validate:"required"`
	UpstreamAddr string `validate:"required"`
}

RunInput holds the configuration for the proxy server.

type TxState

type TxState struct {
	InTx   bool
	HasDDL bool
	HasDML bool
}

TxState tracks transaction state for DDL/DML enforcement warnings.

func (*TxState) TrackTx

func (tx *TxState) TrackTx(sql string) string

TrackTx updates transaction state and returns a warning message if the statement would violate DSQL's transaction rules, or "" if okay.

Jump to

Keyboard shortcuts

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