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.
definewriting 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); 15