sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.09k stars 499 forks source link

Assigning NULL value to column with AsUpdate throws NotSupportedException #693

Closed SeanLawless closed 12 months ago

SeanLawless commented 12 months ago

Hi All,

When using the SqlKata query builder and assigning a column value as NULL it throws a NotSupportedException.

I have tried using (DbValue)null, DBNull.Value and null.

It will update with just "null" but it updates the column as a string containing "null" and not as the default NULL you would expect in SQL Server. How should this be handled?

SeanLawless commented 12 months ago

Expressions.UnsafeLiteral("null")