Skip to content

Conversation

@bitmage
Copy link
Contributor

@bitmage bitmage commented Dec 2, 2014

The SQL data type decimal takes 'precision' and 'scale' options. Currently the loopback code does not support these options. These few lines of code represent a naive implementation.

I'm not certain how to test this. I had thought to call MsSQL.prototype.propertySettingsSQL, but this function is private to the adapter and not exposed via any export. I think being able to unit test some of the SQL building functions would be advantageous, but clearly would require code restructure.

Also, I am using these options in context of the decimal data type, but I imagine there could be other data types that use them as well.

Just out of curiosity, is the ability to supply SQL-specific options to the schema type supported? It seems to have been taken out of the documentation. It was present in 1.x, but is no longer present in 2.x. This is important functionality for certain applications - for instance the project I'm working on needs to handle money and accounting data. Having control over the precision/scale is very useful.

@slnode
Copy link

slnode commented Dec 2, 2014

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

raymondfeng added a commit that referenced this pull request Dec 8, 2014
@raymondfeng raymondfeng merged commit 261fe62 into loopbackio:master Dec 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants