Documentation
¶
Index ¶
- type DefaultExtendedQueryBackend
- func (d *DefaultExtendedQueryBackend) HandleBind(ctx context.Context, portalName string, stmtName string, paramFormats []int16, ...) error
- func (d *DefaultExtendedQueryBackend) HandleClosePortal(ctx context.Context, portalName string) error
- func (d *DefaultExtendedQueryBackend) HandleCloseStatement(ctx context.Context, stmtName string) error
- func (d *DefaultExtendedQueryBackend) HandleDescribePortal(ctx context.Context, portalName string, stmtName string, query string, ...) ([]sqldata.ISQLColumn, error)
- func (d *DefaultExtendedQueryBackend) HandleDescribeStatement(ctx context.Context, stmtName string, query string, paramOIDs []uint32) ([]uint32, []sqldata.ISQLColumn, error)
- func (d *DefaultExtendedQueryBackend) HandleExecute(ctx context.Context, portalName string, stmtName string, query string, ...) (sqldata.ISQLResultStream, error)
- func (d *DefaultExtendedQueryBackend) HandleParse(ctx context.Context, stmtName string, query string, paramOIDs []uint32) ([]uint32, error)
- type IExtendedQueryBackend
- type ISQLBackend
- type QueryCallback
- type SQLBackendFactory
- type SimpleSQLBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultExtendedQueryBackend ¶
type DefaultExtendedQueryBackend struct {
// contains filtered or unexported fields
}
DefaultExtendedQueryBackend provides a default implementation of IExtendedQueryBackend that delegates execution to the simple query path. This is used when the backend does not natively support extended queries.
func (*DefaultExtendedQueryBackend) HandleBind ¶
func (*DefaultExtendedQueryBackend) HandleClosePortal ¶
func (d *DefaultExtendedQueryBackend) HandleClosePortal(ctx context.Context, portalName string) error
func (*DefaultExtendedQueryBackend) HandleCloseStatement ¶
func (d *DefaultExtendedQueryBackend) HandleCloseStatement(ctx context.Context, stmtName string) error
func (*DefaultExtendedQueryBackend) HandleDescribePortal ¶
func (d *DefaultExtendedQueryBackend) HandleDescribePortal(ctx context.Context, portalName string, stmtName string, query string, paramOIDs []uint32) ([]sqldata.ISQLColumn, error)
func (*DefaultExtendedQueryBackend) HandleDescribeStatement ¶
func (d *DefaultExtendedQueryBackend) HandleDescribeStatement(ctx context.Context, stmtName string, query string, paramOIDs []uint32) ([]uint32, []sqldata.ISQLColumn, error)
func (*DefaultExtendedQueryBackend) HandleExecute ¶
func (*DefaultExtendedQueryBackend) HandleParse ¶
type IExtendedQueryBackend ¶
type IExtendedQueryBackend interface {
// HandleParse prepares a SQL statement for later execution.
// paramOIDs may contain zeros for unspecified parameter types.
HandleParse(ctx context.Context, stmtName string, query string, paramOIDs []uint32) ([]uint32, error)
// HandleBind binds parameter values to a prepared statement, creating a portal.
HandleBind(ctx context.Context, portalName string, stmtName string, paramFormats []int16, paramValues [][]byte, resultFormats []int16) error
// HandleDescribeStatement returns parameter type OIDs and result column metadata
// for a prepared statement.
HandleDescribeStatement(ctx context.Context, stmtName string, query string, paramOIDs []uint32) ([]uint32, []sqldata.ISQLColumn, error)
// HandleDescribePortal returns result column metadata for a bound portal.
HandleDescribePortal(ctx context.Context, portalName string, stmtName string, query string, paramOIDs []uint32) ([]sqldata.ISQLColumn, error)
// HandleExecute executes a bound portal and returns a result stream.
// maxRows of 0 means unlimited.
HandleExecute(ctx context.Context, portalName string, stmtName string, query string, paramFormats []int16, paramValues [][]byte, resultFormats []int16, maxRows int32) (sqldata.ISQLResultStream, error)
// HandleCloseStatement closes a prepared statement.
HandleCloseStatement(ctx context.Context, stmtName string) error
// HandleClosePortal closes a portal.
HandleClosePortal(ctx context.Context, portalName string) error
}
IExtendedQueryBackend provides extended query protocol support. Backends that implement this interface (in addition to ISQLBackend) can handle prepared statements, parameter binding, and describe operations.
If an ISQLBackend does not implement this interface, the wire server will use a default implementation that delegates Execute to HandleSimpleQuery.
func NewDefaultExtendedQueryBackend ¶
func NewDefaultExtendedQueryBackend(backend ISQLBackend) IExtendedQueryBackend
type ISQLBackend ¶
type ISQLBackend interface {
HandleSimpleQuery(context.Context, string) (sqldata.ISQLResultStream, error)
SplitCompoundQuery(string) ([]string, error)
GetDebugStr() string
}
func NewSimpleSQLBackend ¶
func NewSimpleSQLBackend(simpleCallback QueryCallback) ISQLBackend
TODO: debug message handling
type QueryCallback ¶
type SQLBackendFactory ¶
type SQLBackendFactory interface {
NewSQLBackend() (ISQLBackend, error)
}
func NewSimpleSQLBackendFactory ¶
func NewSimpleSQLBackendFactory(simpleCallback QueryCallback) SQLBackendFactory
type SimpleSQLBackend ¶
type SimpleSQLBackend struct {
// contains filtered or unexported fields
}
func (*SimpleSQLBackend) GetDebugStr ¶
func (sb *SimpleSQLBackend) GetDebugStr() string
func (*SimpleSQLBackend) HandleSimpleQuery ¶
func (sb *SimpleSQLBackend) HandleSimpleQuery(ctx context.Context, query string) (sqldata.ISQLResultStream, error)
func (*SimpleSQLBackend) SplitCompoundQuery ¶
func (sb *SimpleSQLBackend) SplitCompoundQuery(s string) ([]string, error)
Click to show internal directories.
Click to hide internal directories.