I've been reading and thinking about this topic for a while, and would like to 
add my thoughts.

I realize that we don't "vote" on features, but I feel that this type of idea 
has merit.

It is true, that SQLite has user defined collations, and a extension could be 
registered, but the problem with that is twofold:

Number 1, the database is no longer portable. The only solution to this is to 
include the functionality in the core.

Number 2, your platform may not support the sqlite3_create_collation interface. 
For example, Firefox now includes SQLite. Unfortunately, while Firefox supports 
user defined functions, their implementation does not support user defined 
collations.  

Someone commented that the US lives in a 7-bit world.  
This means that the other 6 billion people on the planet do not.

This creates a real problem for me.  I am writing a foreign language Firefox 
extension, and the issue of sorting is critical, since Firefox uses Unicode 
sorting, which does not "sort" (based on my rules) correctly.   This means I 
have no way to correct the sorting, except in the display routines.

That being said, I would not limit this feature to 8bit locales.  A more 
general solution would be to design it around a sqlite_collation master table 
in the database. An application developer (not the SQLite team) would be 
responsible to define and populate their "user defined" collation.

True, if I call my "user defined" collation sequence "COLLATE_PN", someone else 
might use the same identifier. Their lookup table even be different than the 
"COLLATE_PN" I am using.  However, I feel that is a deployment problem, not a 
development issue.  

It is unlikely that in a single SQLite database, we would have 2 user tables, 
with the same "user defined" collation identifier, but differing collation 
lookups.



I would encourage the developers to at least consider such a feature, after 
all, they did recently add the built-in RTRIM collation.


Regards,

Noah Hart


-----Original Message-----
- Please, let us try to bring down the discussion to the intended solution - a 
simple way to define and use a "user defined" collating for 8 bit ASCII 
characters! 
As said before, the proposal doesn't rely on locales. If a user needs a german 
collating sequence with sort order for phone-book, dictionary or german upper 
case, it's up to the user to supply a simple 256 byte string with the 
wanted/needed sort order for that index. It could be beneficial to all users 
with the need for special sorting requirements and almost no impact to cpu 
cycles, even on small systems. 

There sould be many users with 8bit ASCII locales requirements that would love 
such an extension.
 



CONFIDENTIALITY NOTICE: 
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.


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

Reply via email to