henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

add ToString expression #264

Closed hasancemcerit closed 2 years ago

hasancemcerit commented 3 years ago

PR based on original suggestion found here. #241

codecov[bot] commented 3 years ago

Codecov Report

Merging #264 (dd6f095) into master (67cef37) will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #264      +/-   ##
==========================================
+ Coverage   79.12%   79.21%   +0.08%     
==========================================
  Files          32       32              
  Lines        1188     1193       +5     
  Branches      136      137       +1     
==========================================
+ Hits          940      945       +5     
  Misses        213      213              
  Partials       35       35              
Impacted Files Coverage Δ
src/Dommel/SqlExpression.cs 76.47% <100.00%> (+0.59%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 67cef37...dd6f095. Read the comment docs.

hasancemcerit commented 3 years ago

Good point. Here's the matrix. MS SQL and MySQL/MariaDB, SQLLite supports CHAR

image

image

image ⚠️ SQLLite adds e notation to large numbers, but I guess that is not a concern.

PostgreSQL does NOT support CHAR, default char(1), but supports VARCHAR image

I see an option to add Cast method to DB specific builder interfaces, like you have on limit or pagination, or create an abstract class to allow for future type conversion differences.

@henkmollema your call...

henkmollema commented 2 years ago

Sorry for the late reaction. Let's merge this for now and perhaps add a SQL builder interface method in the future to configure this behavior.