/GoSQL

Primary LanguageGo

GoSQL(SQLite)

Contents

简化SQL查询,查询返回结果为 Map 结构。

https://img.vim-cn.com/c7/c310fc26e8a6be6a1ad55b8692acea27363a85.jpg

程序改为了 命令行调用模式。

# 编译
go build main.go

# 初始化数据库
./main init
# 插入数据
./main query "INSERT INTO auth (uid, name, nickname) VALUES(1, '名字', '昵称') "
# 查询数据
./main query "SELECT * FROM auth"
# 修改数据
./main query "UPDATE auth SET name = '名字很长' WHERE uid=1 "

参考资料: