Re: [sqlite] Custom collation of blobs

2019-04-27 Thread James K. Lowden
On Fri, 26 Apr 2019 10:36:34 -0700 Jens Alfke wrote: > 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, Your UDF need n

Re: [sqlite] Custom collation of blobs

2019-04-27 Thread R Smith
To add to Dominique's suggestion, we use this approach a lot and have sort of standardized it internally. Of course 1NF dictates that this is not the real RDBMS way, but sometimes you need blobs because you just do. I'm sure you already have figured out how to do it sans blob collations, and t

Re: [sqlite] Custom collation of blobs

2019-04-27 Thread Dominique Devienne
On Fri, Apr 26, 2019 at 7:36 PM Jens Alfke wrote: > 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 call

[sqlite] Custom collation of blobs

2019-04-26 Thread Jens Alfke
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 u