[bcn-pm] SQLite - Case-insensitive matching

Enrique Nell blas.gordon a gmail.com
dis des 20 08:19:04 PST 2008


Hola

Por lo que he leído en las preguntas más frecuentes de la
documentación de SQLite, no es posible hacer consultas que no
distingan mayúsculas de minúsculas en texto con caracteres extendidos.
¿Alguien conoce alguna forma poco exigente a nivel intelectual de
añadir esta funcionalidad?
Creo que podría atacar el problema utilizando el método $dbh->func(
$name, $argc, $func_ref, "create_function" ) de DBD::SQLite, aunque
aún no lo he pensado mucho...
Se me ocurren otras posibilidades, pero son un poco absurdas.

(18) Case-insensitive matching of Unicode characters does not work.

The default configuration of SQLite only supports case-insensitive
comparisons of ASCII characters. The reason for this is that doing
full unicode case-insensitive comparisons and case conversions
requires tables and logic that would nearly double the size of the
SQLite library. The SQLite developers reason that any application that
needs full unicode case support probably already has the necessary
tables and functions and so SQLite should not take up space to
duplicate this ability.
Instead of providing full unicode case support by default, SQLite
provides the ability to link against external unicode comparison and
conversion routines. The application can overload the built-in NOCASE
collating sequence (using sqlite3_create_collation()) and the built-in
like(), upper(), and lower() functions (using
sqlite3_create_function()). The SQLite source code includes an "ICU"
extension that does these overloads. Or, developers can write their
own overloads based on their own unicode-aware comparison routines
already contained within their project.

Enrique


Més informació sobre la llista de correu Barcelona-pm