sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

Creating user functions

Open bokolob opened this issue 3 years ago • 6 comments

Hi! Are user functions supported?

bokolob avatar Feb 08 '22 10:02 bokolob

@bokolob Can you elaborate a bit more with example so i can evaluate the work involve to support user functions

jepiqueau avatar Feb 08 '22 10:02 jepiqueau

Hello, I’ve mentioned https://www.sqlite.org/c3ref/create_function.html

It would be great to use some js function in sql.

bokolob avatar Feb 13 '22 08:02 bokolob

@bokolob can you give an example of one of your custom function.

jepiqueau avatar Feb 13 '22 15:02 jepiqueau

I need some spatial methods, for measuring distance between points, rounding them, and some aggregation functions

bokolob avatar Feb 14 '22 14:02 bokolob

It is implemented in sql.js

bokolob avatar Feb 15 '22 17:02 bokolob

@bokolob with sql.js it is quite easy as it is javascript. What i have to look for is how to run javascript sqlite user function in native app ( swift, java)

jepiqueau avatar Feb 15 '22 19:02 jepiqueau

@bokolob i looked at it and i can only implement user functions in web and electron plugin not in iOS and Android. so i do not think i will pursue this as i want to keep as much as possible all plugins inline

jepiqueau avatar Dec 08 '22 10:12 jepiqueau