Documentation ¶
Overview ¶
Package presto provides struct declaration style wrapper to access presto result. See http://prestodb.io ---------------------------- Example usage:
type Info struct { Name string `presto:"name"` Salary int `presto:"salary"` Married bool `presto:"is_married"` }
p, err := presto.NewPrestoQuery(`Select * from employee`)
if err != nil { ... }
defer p.Close() ret := Info{}
for p.Next(&ret) { .... }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrestoConfig ¶
type PrestoConfig struct { Host string User string Source string Catalog string Schema string // contains filtered or unexported fields }
func (*PrestoConfig) GetPrestHost ¶
func (cfg *PrestoConfig) GetPrestHost() string
type PrestoQuery ¶
type PrestoQuery struct {
// contains filtered or unexported fields
}
func NewPrestoQuery ¶
func NewPrestoQuery(sql string) (*PrestoQuery, error)
func NewPrestoQueryWithConfig ¶
func NewPrestoQueryWithConfig(sql string, cfg *PrestoConfig) (*PrestoQuery, error)
func (*PrestoQuery) Close ¶
func (pq *PrestoQuery) Close()
func (*PrestoQuery) Next ¶
func (pq *PrestoQuery) Next(result interface{}) bool
Click to show internal directories.
Click to hide internal directories.