OP-Engineering/op-sqlite

Support other collates

Closed this issue ยท 3 comments

Hello, thank you for this awesome project.

I would like to know if it is possible to use other collates.

SQLite has by default these three collates binary, nocase, rtrim. In my case, I would like to sort text that has accent. Android SQL has UNICODE and LOCALIZED support.

By the way, use default Android SQLite instead of op-sqlite would be just like a crazy decision due the amount of benefits using op-sqlite. :)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Interesting, never used collation functions. I guess I could expose a way to call the collation register function, although that sounds complicated and slow. I guess you could also monkey-patch the sources to register your own C function.

Unfortunately, it is not possible to use the embedded Android SQLite from C++, only from Java. It is also a bad idea since older phones have really old versions with a lot of incompatibilities and each vendor modifies the SQLite implementation causing a lot of errors.

So, just to be clear, not going to implement this myself. This is niche. If you want it, you will have to implement it yourself or do sponsoring.

Going to close this for now, this really seems really niche and the original problem had to do with supporting Android collates which is not possible.