yql

package module
v0.0.0-...-fb0a6c1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 10 Imported by: 1

README

YQL GoLang api wrapper

Simple Yql Queries

db, _ := sql.Open("yql", "")

stmt, err := db.Query(
	"select * from rss where url = ?",
	"http://blog.golang.org/feeds/posts/default?alt=rss")

if err != nil {
	return
}
for stmt.Next() {
	var data map[string]interface{}
	stmt.Scan(&data)
	fmt.Printf("%v\n", data["link"])
	fmt.Printf("  %v\n\n", data["title"])
}

Private Yql Queries

db, _ := sql.Open("yql", *conKey+"|"+*conSecret)

stmt, err := db.Query(
	"select * from contentanalysis.analyze where url=?",
	"http://www.espn.com")

if err != nil {
	return
}
for stmt.Next() {
	var data interface{}
	stmt.Scan(&data)
	fmt.Printf("%v\n", data)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YQLConn

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

func (*YQLConn) Begin

func (c *YQLConn) Begin() (driver.Tx, error)

func (*YQLConn) Close

func (c *YQLConn) Close() error

func (*YQLConn) Prepare

func (c *YQLConn) Prepare(query string) (driver.Stmt, error)

type YQLDriver

type YQLDriver struct{}

func (*YQLDriver) Open

func (d *YQLDriver) Open(dsn string) (driver.Conn, error)

type YQLResult

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

type YQLRows

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

func (*YQLRows) Close

func (rc *YQLRows) Close() error

func (*YQLRows) Columns

func (rc *YQLRows) Columns() []string

func (*YQLRows) Next

func (rc *YQLRows) Next(dest []driver.Value) error

type YQLStmt

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

func (*YQLStmt) Close

func (s *YQLStmt) Close() error

func (*YQLStmt) Exec

func (s *YQLStmt) Exec(args []driver.Value) (driver.Result, error)

func (*YQLStmt) NumInput

func (s *YQLStmt) NumInput() int

func (*YQLStmt) Query

func (s *YQLStmt) Query(args []driver.Value) (driver.Rows, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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