server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "0.6.0"

	// DOLTGRES_DATA_DIR is an environment variable that defines the location of DoltgreSQL databases
	DOLTGRES_DATA_DIR = "DOLTGRES_DATA_DIR"
	// DOLTGRES_DATA_DIR_DEFAULT is the portion to append to the user's home directory if DOLTGRES_DATA_DIR has not been specified
	DOLTGRES_DATA_DIR_DEFAULT = "doltgres/databases"

	DefUserName  = "postres"
	DefUserEmail = "postgres@somewhere.com"
	DoltgresDir  = "doltgres"
)

Variables

This section is empty.

Functions

func NewListener

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

NewListener creates a new Listener.

func NewListenerWithOpts added in v0.5.0

func NewListenerWithOpts(listenerCfg mysql.ListenerConfig, opts ...ListenerOpt) (server.ProtocolListener, error)

func RunInMemory

func RunInMemory(args []string) (*svcs.Controller, error)

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(ctx context.Context, args []string, dEnv *env.DoltEnv) (*svcs.Controller, error)

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 ConnectionHandler added in v0.4.0

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

ConnectionHandler is responsible for the entire lifecycle of a user connection: receiving messages they send, executing queries, sending the correct messages in return, and terminating the connection when appropriate.

func NewConnectionHandler added in v0.4.0

func NewConnectionHandler(conn net.Conn, handler mysql.Handler) *ConnectionHandler

NewConnectionHandler returns a new ConnectionHandler for the connection provided

func (*ConnectionHandler) Conn added in v0.4.0

func (h *ConnectionHandler) Conn() net.Conn

Conn returns the underlying net.Conn for this connection.

func (*ConnectionHandler) HandleConnection added in v0.4.0

func (h *ConnectionHandler) HandleConnection()

HandleConnection handles a connection's session, reading messages, executing queries, and sending responses. Expected to run in a goroutine per connection.

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 DoltgresConfigReader added in v0.5.0

type DoltgresConfigReader struct{}

func (DoltgresConfigReader) ReadConfigArgs added in v0.5.0

func (DoltgresConfigReader) ReadConfigFile added in v0.5.0

func (d DoltgresConfigReader) ReadConfigFile(fs filesys.Filesys, file string) (sqlserver.ServerConfig, error)

type DoltgresServerConfig added in v0.5.0

type DoltgresServerConfig struct {
	*sqlserver.YAMLConfig
	PostgresReplicationConfig *PostgresReplicationConfig `yaml:"postgres_replication,omitempty"`
}

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.

type ListenerOpt added in v0.5.0

type ListenerOpt func(*Listener)

func WithCertificate added in v0.5.0

func WithCertificate(cert tls.Certificate) ListenerOpt

type PortalData added in v0.4.0

type PortalData struct {
	Query        ConvertedQuery
	IsEmptyQuery bool
	Fields       []*querypb.Field
	BoundPlan    sql.Node
}

type PostgresReplicationConfig added in v0.5.0

type PostgresReplicationConfig struct {
	PostgresServerAddress string `yaml:"postgres_server_address"`
	PostgresUser          string `yaml:"postgres_user"`
	PostgresPassword      string `yaml:"postgres_password"`
	PostgresDatabase      string `yaml:"postgres_database"`
	PostgresPort          int    `yaml:"postgres_port"`
	SlotName              string `yaml:"slot_name"`
}

type PreparedStatementData added in v0.4.0

type PreparedStatementData struct {
	Query        ConvertedQuery
	ReturnFields []*querypb.Field
	BindVarTypes []int32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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