新需求:能不能执行SQL的Query之后,提供一种可以返回interface{}的数组的数组,即[][]interface{}? #211
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#211
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
新需求:能不能执行SQL的Query之后,提供一种可以返回interface{}的数组的数组,即[][]interface{}?
因为返回的map的数组,map当中的key是无序的;如果能提供返回[][]interface{},而且[]interface{}当中的顺序是按照当初select 的字段的顺序,这样的比较好了;
录入,执行Query的SQL是Select Id, Name, Value From XXTable, 这样返回的结果可以这样:
[
[Id1, name1, value1]
[Id2, name2, value2]
....
]
可以考虑。
刚才对帖子进行了编辑, 因为我觉得返回字符串的话,并不是太好,因为失去了原来字段类型的信息,不管用来是不是字符类型,最终都变成了字符串,所以改为interface{}吧;
另外,发现Session当中有一个未公开的query2,只是把返回的[]byte,变为了string,这个意义不大吧
这个用法,其实早就有了。