Hacker News new | ask | show | jobs
by thomasdziedzic 13 days ago
> I'm confused why there's a udf for 'if' but it'd be trivial to build as C module, but I agree it's best to patch over this sort of thing separately from the migration, so perhaps limited benefit.

There's actually a built in if to sqlite: https://sqlite.org/lang_corefunc.html#iif

The only reason why I built it as a UDF was because I originally didn't find an if function. Though I'm not sure how I accomplished that thinking back :)

1 comments

Huh TIL! I've spent a lot of the last few weeks reading sqlite docs and somehow either never saw that or forgot it