Max Vlasov wrote:
> On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne <ddevie...@gmail.com> 
> wrote:
>> I think what SQLite lacks is a syntax to define custom function like
>> it does for virtual tables. Something like:
>>
>> create function rpad(x, y) using scripty_module as "return 
>> PRINTF('%-*s',y,x)";
>
> Nice suggestion. This probably falls into case when a small new part
> needed on sqlite side

Actually, no change to SQLite itself would be needed.  It's possible
to create an extension that provides a function that allows to register
another function that executes a custom SQL expression:

 SELECT register_simple_function('rpad', 2, 'SELECT printf(''%-*s'', ?, ?)');


In practice, the biggest problem probably is that SQLite doesn't have
that many built-in functions; most useful functions would require more
than that.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to