SQL构建器
软件包构建器是用于Go和XORM的轻量级且快速SQL构建器。
确保已安装Go 1.8+,然后:
go get xorm.io/builder
插入
sql , args , err := builder . Insert ( Eq { "c" : 1 , "d" : 2 }). Into ( "table1" ). ToSQL ()
// INSERT INTO table1 SELECT * FROM table2
sql , err := builder . Insert (). Into ( "table1" ). Select (). From ( "table2" ). ToBoundSQL ()
// INSERT INTO table1 (a, b) SELECT b, c FROM table2
sql , err = builder . Insert
评论0
最新资源