Documentation
¶
Overview ¶
Package unicode provides an alternative to the SQLite ICU extension.
Like the ICU extension, it provides Unicode aware:
- upper() and lower() functions,
- LIKE and REGEXP operators,
- collation sequences.
It also provides, from PostgreSQL:
- unaccent(),
- initcap().
The implementation is not 100% compatible with the ICU extension:
- upper() and lower() use strings.ToUpper, strings.ToLower and cases;
- the LIKE operator follows strings.EqualFold rules;
- the REGEXP operator uses Go regexp/syntax;
- collation sequences use collate.
Expect subtle differences (e.g.) in the handling of Turkish case folding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RegisterLike = true
Set RegisterLike to false to not register a Unicode aware LIKE operator. Overriding the built-in LIKE operator disables the LIKE optimization.
Functions ¶
func Register ¶
func Register(db *sqlite3.Conn) error
Register registers Unicode aware functions for a database connection.
func RegisterCollation ¶ added in v0.8.5
RegisterCollation registers a Unicode collation sequence for a database connection.
func RegisterCollationsNeeded ¶ added in v0.19.0
func RegisterCollationsNeeded(db *sqlite3.Conn) error
RegisterCollationsNeeded registers Unicode collation sequences on demand for a database connection.
Types ¶
This section is empty.