We are using SQLite blobs to store some structured values, and need control 
over how they are collated in queries, i.e. memcmp is not the correct ordering. 
We’ve registered a custom collating function, but unfortunately it doesn’t get 
called. According to the docs, collating functions are only used to compare 
strings, not any other data type. Is there any way around this limitation?

The only workaround I can think of is to define a custom function that converts 
a blob to a string and collate using those strings — e.g. `… ORDER BY 
collatable_blob(b)`. But this requires expensive string conversions, and it 
doesn’t work well with indexes.

It would be much cleaner and more efficient if there were a type of collating 
function that operated on all data types.

—Jens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to