2 Star 0 Fork 0

WFL/sqltemplate

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 439 Bytes
一键复制 编辑 原始数据 按行查看 历史
WFL 提交于 2021-03-27 18:40 +08:00 . feat: 初始化提交
package main
import (
"fmt"
"gitee.com/sqxwww/sqltemplate"
)
func main() {
tpl := sqltemplate.New(sql)
fmt.Println(tpl.Parse(map[string]interface{}{
"col2": "const",
"id": 231,
"size": []int{1, 3, 5},
})) // result select col1, 'const' as col2 from table where id = ? and size in (?,?,?) [231 1 3 5]
}
var sql = `select col1, '{{param .col2}}' as col2 from table where id = {{prepare .id}} and size in ({{prepare .size}})`
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/sqxwww/sqltemplate.git
git@gitee.com:sqxwww/sqltemplate.git
sqxwww
sqltemplate
sqltemplate
39fc43b371d8

搜索帮助