SQLite Forum

json_contains Function Idea
Login
Neat, I'll have to look into that extension.

As of just a few days ago I started working on my own extension just for this function (slow going since I don't know C). It's still not quite done (I'm betting there are things I hadn't considered, like if the JSON was NULL as mentioned in your version. Also I use '#include "json1.c"' which results in a lot of extra stuff being compiled into the .so, which isn't great), but I'm thinking of posting it in this thread when I'm done.

A quick test showed 6-8x speed improvement over my python user-defined function and a 10-50% improvement over using json_each. Not really important for my usage since all uses of it in my code currently are fast anyway, but it's been fun figuring out how to make it work and learning a little C.