server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "0.2.0"
)

Variables

This section is empty.

Functions

func HandleImplicitCommitStatement added in v0.2.0

func HandleImplicitCommitStatement(statement string) (reverseStatement string, handled bool)

HandleImplicitCommitStatement returns a statement that can reverse the given statement, such that it appears to have never executed. This only applies to statements that implicitly commit, as determined by ImplicitlyCommits.

func ImplicitlyCommits

func ImplicitlyCommits(statement string) bool

ImplicitlyCommits returns whether the given statement implicitly commits. Case-insensitive.

func NewLimitedListener

func NewLimitedListener(listenerCfg mysql.ListenerConfig) (server.ProtocolListener, error)

NewLimitedListener creates a new LimitedListener.

func NewListener

func NewListener(listenerCfg mysql.ListenerConfig) (server.ProtocolListener, error)

NewListener creates a new Listener.

func RunInMemory

func RunInMemory(args []string) (*int, *sync.WaitGroup)

RunInMemory starts the server based on the given args, while also using RAM as the backing store. The returned WaitGroup may be used to wait for the server to close.

func RunOnDisk

func RunOnDisk(args []string) (*int, *sync.WaitGroup)

RunOnDisk starts the server based on the given args, while also using the local disk as the backing store. The returned WaitGroup may be used to wait for the server to close.

Types

type ConvertedQuery added in v0.2.0

type ConvertedQuery struct {
	String string
	AST    vitess.Statement
}

ConvertedQuery represents a query that has been converted from the Postgres representation to the Vitess representation. String may contain the string version of the converted query. AST will contain the tree version of the converted query, and is the recommended form to use. If AST is nil, then use the String version, otherwise always prefer to AST.

type LimitedListener

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

LimitedListener automatically shuts down the listener after two connections close. This is intended only for testing. Tests will always make use of two connections, and they are as follows: 1. Establish a connection, and create the database. Disconnect afterward (Postgres enforces one connection per database). 2. Establish a connection, and run all of the queries relevant to the database. Tests that do not use the framework provided may not adhere to the above rules, and therefore must find another way to properly close their servers.

func (*LimitedListener) Accept

func (l *LimitedListener) Accept()

Accept implements the interface server.ProtocolListener.

func (*LimitedListener) Addr

func (l *LimitedListener) Addr() net.Addr

Addr implements the interface server.ProtocolListener.

func (*LimitedListener) Close

func (l *LimitedListener) Close()

Close implements the interface server.ProtocolListener.

type Listener

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

Listener listens for connections to process PostgreSQL requests into Dolt requests.

func (*Listener) Accept

func (l *Listener) Accept()

Accept handles incoming connections.

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

Addr returns the address that the listener is listening on.

func (*Listener) Close

func (l *Listener) Close()

Close stops the handling of incoming connections.

func (*Listener) HandleConnection

func (l *Listener) HandleConnection(conn net.Conn)

HandleConnection handles a connection's session.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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