2 Star 0 Fork 0

mirrors_threez/go-sqlite3

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
extension.go 778 Bytes
Copy Edit Raw Blame History
mattn authored 2014-01-23 09:56 +08:00 . Add example that query github repositories
package main
import (
"database/sql"
"fmt"
"github.com/mattn/go-sqlite3"
"log"
)
func main() {
sql.Register("sqlite3_with_extensions",
&sqlite3.SQLiteDriver{
Extensions: []string{
"sqlite3_mod_vtable",
},
})
db, err := sql.Open("sqlite3_with_extensions", ":memory:")
if err != nil {
log.Fatal(err)
}
defer db.Close()
db.Exec("create virtual table repo using github(id, full_name, description, html_url)")
rows, err := db.Query("select id, full_name, description, html_url from repo")
if err != nil {
log.Fatal(err)
}
defer rows.Close()
for rows.Next() {
var id, full_name, description, html_url string
rows.Scan(&id, &full_name, &description, &html_url)
fmt.Printf("%s: %s\n\t%s\n\t%s\n\n", id, full_name, description, html_url)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_threez/go-sqlite3.git
git@gitee.com:mirrors_threez/go-sqlite3.git
mirrors_threez
go-sqlite3
go-sqlite3
d055d0f27e96

Search