Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite 报错 ColumnNotFound("0") #15

Closed
ggggxiaolong opened this issue Sep 16, 2020 · 6 comments
Closed

Sqlite 报错 ColumnNotFound("0") #15

ggggxiaolong opened this issue Sep 16, 2020 · 6 comments

Comments

@ggggxiaolong
Copy link
Contributor

panicked at 'called `Result::unwrap()` on an `Err` value: ColumnNotFound("0")', /home/mrtan/.cargo/registry/src/github.com-1ecc6299db9ec823/rbatis-core-1.5.2/src/sqlite/cursor.rs:78:83

下面是debug的跟踪数据, 应该是row的key不能直接是"0,1,2.."

image

image

image

image

image

@zhuxiujia
Copy link
Member

row的key

row的数据里面似乎只有values 也就是 usize.估计搞错了,不知道它的column数据在哪...

@ggggxiaolong
Copy link
Contributor Author

我有一个大胆的想法
image

@ggggxiaolong
Copy link
Contributor Author

或者 我看row 里面 statement 里面有一个方法 column_name
image

@zhuxiujia
Copy link
Member

zhuxiujia commented Sep 16, 2020

或者 我看row 里面 statement 里面有一个方法 column_name
image

估计就是这个,先拿到vlaues的usize大小,然后for循环逐个通过这个方法获取 column name,然后应该就可以取value了。
晚点我修复下,去掉TODO标记,再测一下估计没问题了

@ggggxiaolong
Copy link
Contributor Author

还有一个问题: 数据库貌似没有正常关闭,跑完单元测试数据库的生成的两个文件没有删

image

@zhuxiujia
Copy link
Member

还有一个问题: 数据库貌似没有正常关闭,跑完单元测试数据库的生成的两个文件没有删

image

这2个文件不删有问题吗?

zhuxiujia added a commit that referenced this issue Sep 16, 2020
zhuxiujia added a commit that referenced this issue Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants