Static Propertygrdb 7.4.0GRDB

localizedCompare

A collation that compares strings according to the Foundation String.localizedCompare(_:) method.

StandardLibrary.swift:903
static let localizedCompare: DatabaseCollation

This collation is automatically added by GRDB to your database connections.

You can use the collation when creating database tables:

try db.create(table: "player") { t in
    t.column("name", .text).collate(.localizedCompare)
}

Embed the collation name in your raw SQL queries:

let collationName = DatabaseCollation.localizedCompare.name
dbQueue.execute(sql: """
    CREATE TABLE player (
      name TEXT COLLATE \(collationName)
    )
    """)