4
发现个 pure go 的 sqlite 驱动
source link: https://www.v2ex.com/t/796538
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
发现个 pure go 的 sqlite 驱动
源于 tg 群群友的推荐
文档: https://pkg.go.dev/modernc.org/sqlite 而且还有相应的 gorm 的驱动:https://github.com/cloudquery/sqlite
这样似乎用不到 cgo 了,而且 goreleaser 什么的好像都能跑
有没有人用过这个库,性能什么的差别大吗?如果不错的话感觉挺香的
19 条回复 • 2021-08-19 22:18:00 +08:00
meshell 1 天前 1
gamexg 1 天前
Smash 1 天前 2
我有一个项目,用了 cgo 版本的 sqlite,CGO 是 ENABLE=1,在 docker 环境下的 alpine 上跑不起来。
用 file 命令查看可执行文件,发现是动态链接,很多 alpine 的动态链接库不兼容,最后需要改为静态链接。
最后加上 -linkmode "external" -extldflags "-static" 的 ldflag 参数才搞定。
用 file 命令查看可执行文件,发现是动态链接,很多 alpine 的动态链接库不兼容,最后需要改为静态链接。
最后加上 -linkmode "external" -extldflags "-static" 的 ldflag 参数才搞定。
danc 1 天前
https://gitlab.com/cznic/ccgo/-/blob/master/v3/main.go
```
//TODO parallel
//TODO CPython
//TODO Cython
//TODO gmp
//TODO gofrontend
//TODO gsl
//TODO gtk
//TODO hdf5
//TODO minigmp
//TODO mpc
//TODO mpfr
//TODO pcre
//TODO pcre2
//TODO quickjs
//TODO redis
//TODO tcl/tk
//TODO wolfssl
//TODO zdat
//TODO zlib
```
```
//TODO parallel
//TODO CPython
//TODO Cython
//TODO gmp
//TODO gofrontend
//TODO gsl
//TODO gtk
//TODO hdf5
//TODO minigmp
//TODO mpc
//TODO mpfr
//TODO pcre
//TODO pcre2
//TODO quickjs
//TODO redis
//TODO tcl/tk
//TODO wolfssl
//TODO zdat
//TODO zlib
```
kekeabab 7 小时 30 分钟前
至少这个库,我觉得交叉编译很友好呀
GOOS=linux GOARCH=arm64 go build -x -trimpath -a -ldflags '-extldflags "-static -fpic -s -w"' .
环境是
archlinux 5.13.10-arch1-1 linux/amd64 x86_64
go version go1.17
GOOS=linux GOARCH=arm64 go build -x -trimpath -a -ldflags '-extldflags "-static -fpic -s -w"' .
环境是
archlinux 5.13.10-arch1-1 linux/amd64 x86_64
go version go1.17
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK