【发布时间】:2015-11-24 16:01:55
【问题描述】:
我正在尝试使用 mysql-adapter 从 mysql 表中显示一个表 表中的ID格式如下
14482773051001000000
14482773051001000001
14482773051001000002
但是sails 会吐出每个ID,比如
14482773051001000000
14482773051001000000
14482773051001000000
基本上用 0 替换所有最后的数字。
我尝试过 autoPK false 并将大小设置为 64 以获取 bigint,但无济于事。
我的属性当前设置如下:
autoPK: false,
schema: true,
attributes: {
id: {
type: 'integer',
size: 64,
unique: true,
autoIncrement:true,
primaryKey: true
},
有人可以帮忙吗? :/
回答
答案是通过 MysqlAdapter 开启 supportBigNumbers: true
mysql连接:{ 适配器:'sails-mysql', 主机:'192.168.xx', 用户:'用户名', 密码:'密码', 数据库:'myDb', 支持大数字:真 },
感谢@japel https://github.com/japel 在 gitter 上
【问题讨论】: