On Wednesday, 22 May, 2019 19:06, Simon Slavin <[email protected]> wrote:
>Since there are people posting who appear know about these things … >Suppose I want SQlite to handle my own type. Or to do its best to >simulate that. IP address, x/y location, something like that. What >should I be doing ? Do I store BLOBs and define my own COLLATEs ? >Or didn't I read somewhere that COLLATE works only on TEXT ? Technically, COLLATE only works on TEXT. Most people declare their own types as binary blobs and the programmer has to keep track of what is in there and how to work with it. In the case of IPAddresses it is a little simpler, since they are really just text strings, so writing an IPADDRESS collation to apply to text strings that contain IP Addresses and a function like IPSubnetContains is pretty straightforward. Other complex data types are more difficult since there is not builtin support for types. http://www.dessus.com/files/ipaddress.c The code is a little inefficient but it works ... --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

