Skip to content

Instantly share code, notes, and snippets.

@groue
Created March 29, 2016 19:23
Show Gist options
  • Save groue/ad328f4a72cd8035f353e62324456a09 to your computer and use it in GitHub Desktop.
Save groue/ad328f4a72cd8035f353e62324456a09 to your computer and use it in GitHub Desktop.
func setupDatabase() {
// That "collation" helps us compare person names in a localized case insensitive fashion
let collation = DatabaseCollation.localizedCaseInsensitiveCompare
try! dbQueue.execute(
"CREATE TABLE persons (" +
"id INTEGER PRIMARY KEY, " +
"name TEXT NOT NULL COLLATE \(collation.name), " +
"score INTEGER NOT NULL " +
")")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment