func (r *PgPreparedStatementRegistry) CursorByName(name string) (base.Cursor, error) {
	s, ok := r.cursors[name]
	if ok {
		return s, nil
	}
	return nil, ErrCursorNotFound
}
CursorByName returns a cursor from the registry by its name, if it exists.
package postgresql
import (
	"errors"
	"github.com/cossacklabs/acra/decryptor/base"
	"github.com/cossacklabs/acra/sqlparser"
)
var (
	ErrStatementNotFound = errors.New("no prepared statement with given name")
	ErrCursorNotFound    = errors.New("no cursor with given name")
)
type PgPreparedStatementRegistry struct {
	statements map[string]base.PreparedStatement
	cursors    map[string]base.Cursor
}
func NewPreparedStatementRegistry() *PgPreparedStatementRegistry {
	return &PgPreparedStatementRegistry{
		statements: make(map[string]base.PreparedStatement),
		cursors:    make(map[string]base.Cursor),
	}
}
func (r *PgPreparedStatementRegistry) StatementByName(name string) (base.PreparedStatement, error) {
	s, ok := r.statements[name]
	if ok {
		return s, nil
	}
	return nil, ErrStatementNotFound
}