You could create a virtual table and use insert statements to generate new functions. Not sure if that's actually any better though. On Nov 25, 2015 3:10 PM, "Abilio Marques" <abiliojr at gmail.com> wrote:
> Hi, > > I've finished a version of an extension that let's you define new SQL > functions using JavaScript, > > https://github.com/abiliojr/sqlite-js > > > But I have 2 questions to see if someone can give me ideas: > > 1. So far, to call the function that defines new function, I'm using > SELECT, e.g., > ?? > > SELECT createjs('cos', 'Math.cos(arg[0])'); > > Is there a better way to call a function defined with > sqlite3_create_function, > as in this case, I'm not really performing an SQL operation. Something like > a pragma would be useful, but I can't seem to find a way to define a new > one from within an extension. > > 2. That function (createjs) returns errors in case of error, but, is there > a cleaner, more standard way to return an OK status? So far I've checked > the C API, but I didn't manage to find something like that. Do functions > need to return anything at all? > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >