Skip to content
YQL database driver for golang. http://mattn.kaoriya.net/
Go
Find file
Latest commit 3de8900 @mattn Merge pull request #1 from MichalPokorny/allow-custom-env
Allow passing custom env to query
Failed to load latest commit information.
example Allow passing custom env to query
README.md Update README.md
yql.go Allow passing custom env to query

README.md

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)
}
Something went wrong with that request. Please try again.