We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>@gqcn你好,mysql字段类型int unsigned DEFAULT NULL时,查询后值类型为string,期望的类型是int
CREATE TABLE `test_table` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `number` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
package main import ( "fmt" _ "github.com/gogf/gf/contrib/drivers/mysql/v2" "github.com/gogf/gf/v2/frame/g" ) func main() { one, err := g.Model("test_table").One() if err != nil { panic(err) } id, _ := one["id"] fmt.Printf("id: %V\n", id) number, _ := one["number"] fmt.Printf("number: %V\n", number) }
Originally posted by @ANG-LD in #4067 (comment)
The text was updated successfully, but these errors were encountered:
@ANG-LD 我在 #4107 解决了这个问题,但这个pr需要更多的时间进行review。
Sorry, something went wrong.
gqcn
No branches or pull requests
Originally posted by @ANG-LD in #4067 (comment)
The text was updated successfully, but these errors were encountered: