Comments (3)
@cgsunshine 底层驱动在没有数据的时候返回的是0, 你这个nil是在什么情况下出现的, 能否提供一下用法示例呢, 以便彻底排查清楚问题并解决, 谢谢
from gorose.
order, err3 := connect.Table("order").Where("memberuuid", uuid).Count()
如果查不到值 就报错 改了之后是这样
// Count : select count rows
func (dba Session) Count(args ...string) (int64, error) {
fields := ""
if len(args) > 0 {
fields = utils.ParseStr(args[0])
}
count, err := dba.UnionAct("count", fields)
if count == nil {
count = int64(0)
}
return count.(int64), err
}
from gorose.
@cgsunshine 恩, 我复现了这个错误, 当我把字段名字写错的时候, 就会panic错误, order的值确实为nil, 多谢指出, 这里没有做严谨性判断, 你可以把这段代码提一个 pr , 我合并到主分支, 也算是你参与的一部分
from gorose.
Related Issues (20)
- preceding tag (v0.0.3-rc) not found HOT 1
- 当 IN 查询的条件为空数组时报错
- 提供 IfEnableSqlLog() 功能
- runtime error: invalid memory address or nil pointer dereference in driver.Open
- 结构体继承之后再进行映射会有问题
- 是否考虑引入Finisher方法的概念
- 在使用 engin.SetLogger(Logger) 的时候报错,期望官方的 type ILogger interface 支持 go.uber.org/zap
- 为什么批量写入会出错,将multi_data 的数据删除一条,成功执行
- 使用 insert对ClickHouse进行新增操作 ,插入一条数据成功后,拿不到count,而且err!=nil
- 这个没办法手动设置要查询的数据库么?
- 这个框架还在更新么?结构体字段支持map、slice或自定义结构体么 HOT 1
- 想要在日志里记录trace/request id HOT 1
- Prefix 问题 HOT 1
- json_contains(contactIdList,38710)
- transaction中使用select()会造成执行结果无法写回映射对象
- Execute无法执行lock tables 之类的sql HOT 2
- Execute无法执行lock tables 之类的sql HOT 1
- 如何实现多个数据库之前的切换使用
- Where编译时bool参数的问题
- panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1002959f9] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorose.