sqlkata/querybuilder

Update/Insert statement doesn't accept DbType for parameter arguments

KostetskyiYaroslav opened this issue · 1 comments

Issue: Update/Insert statement doesn't access DbType so SQLKata can't put right identifiers for rows that need to be managed

Examples: Notifications table has Body column that has NVarChar(MAX) type.
During usage of AsUpdate of 2.3.7 version ( even latest probably ) the library doesn't put 'N' idenitfier for the value to be set instead of current value.
As the result engine of SQL Server puts question mark symbols instead of all characters ( emoji, all cyclic languages its number about ~50 )

It brings some nuances, but here are two workarounds I've found

  • #154

  • An item of Command.Parameters has SqlParameter type which has SqlDbType.
    So if you change Command.Parameters[index].SqlDbType = SqlDbTypes.NVarChar - it works correctly.

As the result all characters of the value passed thru the parameter is saved correctly based on column type.