Bigint DataType MySQL Connector Support for Big Numbers

8 views
Skip to first unread message

kclev

unread,
Aug 16, 2018, 11:28:04 AM8/16/18
to LoopbackJS
I'm using Loopback 3.x with the MySQL connector, and setting the MySQL data type to "bigint" on my model property does not seem to pull through when I seed the database (using auto-migration):

    "dcapacity": {
     "type": "number",
     "mysql": {
       "dataType": "bigint"
     }
   }

The value I am trying to seed into the db field:
dcapacity: 2325510656

But I keep getting the MySQL "out of range value for column dcapacity" error when I try to seed the db. I know everything works correctly because I can reduce the size of the number then it works fine. When I look in the db it never seems to change the dcapacity column data type from 'int' to 'bigint'.

I also tried setting the "supportBigNumbers" property on the connector to true in datasources.json, but that did not seem to help either. I am not sure what I am doing wrong here, any input is greatly appreciated ;)

Thank you for your time!


Muhammad Usama

unread,
Aug 16, 2018, 12:24:48 PM8/16/18
to loopb...@googlegroups.com
this is the bug in this conenctor you need to manualy change the data type of the column in database

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/32efa309-5886-4b10-aa04-bcbddac54a60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Thank you!

Regards,
Muhammad Usama
Reply all
Reply to author
Forward
0 new messages