requery / sqlite-android

Android SQLite support library
Apache License 2.0
1.05k stars 138 forks source link

ORDER BY ... COLLATE LOCALIZED #144

Open kr580vm80a opened 3 years ago

kr580vm80a commented 3 years ago

I had a need to embed the latest SQLite in my application. I have included your library and tried a simple query:

SELECT first_name
FROM clients
ORDER BY first_name COLLATE LOCALIZED

However, the data is sorted in the wrong order. For example:

1.Євген 2.Андрій 3.Даніель 4.Орест

And it should be like this:

1.Андрій 2.Даніель 3.Євген 4.Орест

Does your framework support locales? I used "uk_UA". If so, what do I need to do to make the request sort the data in the correct order?

mikehardy commented 3 years ago

This is kind of a self-service repository because it's a mostly boring repackage, I say that because you'll have to be ready to roll your sleeves up and figure it out

You might find this interesting

https://github.com/requery/sqlite-android/blob/25c5d9e87f92c22634d4b924f15d12198889d81f/sqlite-android/src/main/jni/sqlite/README#L27-L31

...and maybe this to play around https://github.com/requery/sqlite-android/blob/master/sqlite-android/src/main/jni/sqlite/Android.mk

kr580vm80a commented 3 years ago

Do you have an example of how this can be done? Thanks

mikehardy commented 3 years ago

Sorry @kr580vm80a no idea, c.f.

This is kind of a self-service repository because it's a mostly boring repackage, I say that because you'll have to be ready to roll your sleeves up and figure it out

Not our use case, so no experience with it