How to sort text in sqlite3 with specified locale?(如何使用指定的语言环境对 sqlite3 中的文本进行排序?)
问题描述
Sqlite3 默认只按 ascii 字母排序.我试图在 google 中查找,但我发现的唯一内容是有关排序规则的信息.Sqlite3 只有 NOCASE、RTRIM 和 BIARY 排序规则.如何添加对特定语言环境的支持?(我在 Rails 应用程序中使用它)
Sqlite3 by default sorts only by ascii letters. I tried to look in google, but the only thing I found were informations about collations. Sqlite3 has only NOCASE, RTRIM and BIARY collations. How to add support for a specific locale?
(I'm using it in Rails application)
推荐答案
SQLite 支持与ICU的集成.根据自述文件,sqlite/ext/icu/README.txtsqlite/ext/icu/ 目录包含 SQLiteICU"扩展的源代码,一个将Unicode 国际组件"库与 SQLite 集成.
SQLite supports integration with ICU. According to the Readme file,
sqlite/ext/icu/README.txt
the sqlite/ext/icu/ directory contains source code for the SQLite "ICU" extension, an
integration of the "International Components for Unicode" library with SQLite.
1. Features
1.1 SQL Scalars upper() and lower()
1.2 Unicode Aware LIKE Operator
1.3 ICU Collation Sequences
1.4 SQL REGEXP Operator
这篇关于如何使用指定的语言环境对 sqlite3 中的文本进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用指定的语言环境对 sqlite3 中的文本进行排序?
基础教程推荐
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
