user-defined functions

last updated: Oct 20, 2023

a short post about the define function from sqlean:

SQLite provides an extension mechanism. One of such extensions — define — allows writing functions in regular SQL.

With define writing a custom function becomes as easy as:

select define('sumn', ':n * (:n + 1) / 2');

And then using it as any built-in function:

> select sumn(5);
↑ up