Skip to content

Conversation

@MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Oct 26, 2025

PR is a continuation of the work done in #2377, bringing that change across providers as makes sense. As part of this, now:

  1. For sqlite, we will apply (p,s) args if precision is not empty and scale is not null, so that doing (10,0) is possible (same as mysql)
  2. For sqlserver, if precision or scale is defined and you're using a decimal, than we will apply the (p,s) args with an appropriate default of (18,0) (defaults used as defined in the sqlserver decimal docs) is one is omitted. So it's possible to do just 'scale' => 5, and then precision will be implicitly set to 18, and you'll get (18,5). This brings its behavior in line with how postgres works (though it has a default of 10 for precision).
  3. For sqlserver, when fetching columns, for decimals, we set precision. We also now always set scale as well (though it's expected that this will only be defined for numeric types anyway).

As part of this, I did learn that under the hood, precision and limit are equivalent for defining a column, which does prevent just using a precision for mysql and sqlite. It would separate out the behavior, but this would be a breaking change and thought would need to be made on the best approach.

@MasterOdin MasterOdin marked this pull request as ready for review October 27, 2025 19:05
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.

2 participants