Help us shape the future of Go! Take the 2026 Go Developer Survey

query

package
v0.510.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

DB represents a database that can execute queries

type Service

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

Service proxies query requests to multiple database instances

func New

func New(ctx context.Context, module *schema.Module, addresses *xsync.MapOf[string, string]) (*Service, error)

func (*Service) AddQueryConn added in v0.471.0

func (s *Service) AddQueryConn(ctx context.Context, name string, dsn deploymentcontext.Database) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) ExecuteQueryInternal added in v0.471.0

func (s *Service) ExecuteQueryInternal(ctx context.Context, req *connect.Request[querypb.ExecuteQueryRequest], stream serverStream) error

func (*Service) Ping

func (*Service) UpdateConnections added in v0.464.0

func (s *Service) UpdateConnections(ctx context.Context, module *schema.Module, addresses *xsync.MapOf[string, string]) error

UpdateConnections updates the connections based on a new module and addresses during hot reloading. It fails if any database has configuration or connection issues.

Jump to

Keyboard shortcuts

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