'discoverModelProperties' function returning type of a column as 'String' for 'DECIMAL' column.
discoverModelProperties function returning type as string for decimal field of mysql
Description/Steps to reproduce
In TITANIC dataset, I have a field names 'age' in mysql with following description: | Field | Type | Null | Key | Default | Extra | | Age | decimal(10,0) | NO | | 0 | |
I have used discoverModelProperties function to obtain properties of columns of TITANIC dataset. I have got following desc for age field: RowDataPacket { owner: 'TITANIC', tableName: 'test', columnName: 'Age', dataType: 'decimal', dataLength: null, dataPrecision: 10, dataScale: 0, columnType: 'decimal(10,0)', nullable: 'N', generated: 0, type: 'String' }
Expected result
Type field for age column should have been 'Number', but it is 'String'.
Additional information
@balauppalapati : the source code in the mysql connector below shows dataType is the data type of the column Age
https://github.com/strongloop/loopback-connector-mysql/blob/master/lib/discovery.js#L163
which is decimal which should be Number
https://github.com/strongloop/loopback-connector-mysql/pull/306
The PR has been merged to the master. The fix will be released in the next release cycle. Thanks, @balauppalapati Closing.