presto

package
v0.0.0-...-7f81a18 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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

Jump to

Keyboard shortcuts

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