sqler官方文档使用详细介绍
2019-04-12 本文已影响0人
会飞的猪_password
首先贴出官方文档的地址 https://github.com/alash3al/sqler#configuration-overview
官方文档一句话介绍了sqler的是什么?
使用直接SQL查询编写API没有麻烦,让我们重新思考SQL
然后去这里下载它的各个版本

不要下载使用2.1的,亲测2.1的运行不了使用2.0的就可以,我下载的是linux64位版本的

继续看文档

他说把包改名字sqler,改不改影响不大,然后放在那个路径下,放哪都行,关键是当前目录下运行,
然后输入命令sqler -h

这个命令只是把帮助文档显示出来了,记住,这个文档很重要,他告诉你了怎么启动
首先要使用./sqler 然后呢,要把后面的几个串起来
./sqler -Config "config.example.hcl" -driver "mysql" -dsn "root:root@tcp(127.0.0.1)/test?multiStatements=true"
连接这么多就可以了,其他默认,那个数据库改成自己的数据库,tcp是协议,test是你的数据库名字,

然后就启动成功了
那个config.example.hcl文件官方文档给的有,不用改就可以用,这个文档里暴漏了几个可以访问的接口,

然后浏览器访问

这就可以了
然后用postman添加自己的库表

官方文档比较粗糙,有同行不懂得可以的留言给我