内容简介:zorm,golang 轻量级 ORM,readygo子项目 源码地址:https://gitee.com/chunanyong/zorm go get gitee.com/chunanyong/zorm 基于原生sql语句编写,是springrain的精简和优化. 自带代码生成器 代码精简,总计2000行...
zorm,golang 轻量级 ORM,readygo子项目
源码地址:https://gitee.com/chunanyong/zorm
go get gitee.com/chunanyong/zorm
- 基于原生 sql 语句编写,是springrain的精简和优化.
- 自带代码生成器
- 代码精简,总计2000行左右,注释详细,方便定制修改.
- 支持事务传播,这是zorm诞生的主要原因
- 支持mysql,postgresql,oracle,mssql,sqlite
- 支持数据库读写分离
- 更新性能zorm,gorm,xorm相当. 读取性能zorm比gorm,xorm快一倍
- 测试用例即文档: https://gitee.com/chunanyong/readygo/blob/master/test/testzorm/BaseDao_test.go
生产使用参考 UserStructService.go
更新内容如下:
- 增加达梦数据的分页适配
- 完善调整代码注释
- 增加存储过程和函数的调用示例
//TestProc 13.测试调用存储过程
func TestProc(t *testing.T) {
user := permstruct.UserStruct{}
finder := zorm.NewFinder().Append("call testproc(?) ", "u_10001")
zorm.Query(ctx, finder, &user)
fmt.Println(user)
}
//TestFunc 14.测试调用自定义函数
func TestFunc(t *testing.T) {
userName := ""
finder := zorm.NewFinder().Append("select testfunc(?) ", "u_10001")
zorm.Query(ctx, finder, &userName)
fmt.Println(userName)
}
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Smashing Book
Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90
The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!