+-
gorm Raw原生查询 unsupported destination, should be slice or struct

使用gorm查询select database(),结果报错,提示 unsupported destination, should be slice or struct
代码如下:

func showCurrentDb() {
    var database string
    persistence.GetDB().Raw("select database()").Scan(&database)
    fmt.Println("database ", database)
}

官方有一个例子
https://gorm.io/docs/sql_buil...

var age int
db.Raw("select sum(age) from users where role = ?", "admin").Scan(&age)

为何这里却不行了?