Ai
1 Star 0 Fork 0

tdcq/go-sqlcipher-gm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
extension.go 789 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangjinpeng 提交于 2023-06-30 14:22 +08:00 . 修改代码
package main
import (
"database/sql"
"fmt"
"log"
sqlite3 "github.com/mutecomm/go-sqlcipher/v4"
)
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, fullName, description, htmlURL string
rows.Scan(&id, &fullName, &description, &htmlURL)
fmt.Printf("%s: %s\n\t%s\n\t%s\n\n", id, fullName, description, htmlURL)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/revftg/go-sqlcipher-gm.git
git@gitee.com:revftg/go-sqlcipher-gm.git
revftg
go-sqlcipher-gm
go-sqlcipher-gm
v0.0.5

搜索帮助