Fork me on GitHub

With HugSQL, how do you deal with nullable parameters in inserts/updates? Setting the parameter as nil results in Parameter Mismatch: :foo parameter data not found.


@scott-abernethy: Are you using the latest HugSQL 0.4.7? There was a bug a while back that would error on false or nil values, but that was fixed. HugSQL does expect the parameter keyword to exist, though, so you need to pass nil in as the parameter value. If you want to omit the parameter entirely, then look at Clojure Expressions to conditionally introduce parameters into your query at runtime:


@curtis.summers: Yes, upgrading fixed the issue. Thanks!