我正在尝试使用 mysql-adapter 在 mysql 表中显示 sails 中的表 表格中的 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.x.x', 用户:'用户名', 密码:'密码', 数据库:'myDb', 支持BigNumbers:真 },
感谢@japel https://github.com/japel在抖音上
最佳答案
答案是通过 MysqlAdapter 打开 supportBigNumbers: true
myMysqlConnection: {
adapter: 'sails-mysql',
host: '192.168.x.x',
user: 'username',
password: 'password',
database: 'myDb',
supportBigNumbers: true
},
感谢@japel https://github.com/japel在抖音上
关于mysql - Sailsjs 不输出 bigint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33898344/