I just upgraded to the latest stable version of both XCode (10.3) and SQLite.swift for macOS and I now experience one build issue, maybe obvious, that I cannot seem to be able to fix.
func strings(for symbols: [Character]) -> [String] {
let timing = Date()
if let stringdom = stringdom {
let strings = stringdom.strings(for: symbols)
os_log("LEXICON...Strings()→Cache: %.2f seconds", log: LexiconLog, type: .debug, Date().timeIntervalSince(timing))
return strings
} else if let connection = connection {
do {
let isSubsetOf: (Expression<String>, Expression<String>) -> Expression<Bool> = (
try connection.createFunction("isSubsetOf", deterministic: true) { string, symbols in
return string.isSubsetOf(symbols)
}
)
let strings = try connection.prepare(
SQLiteDatabaseLexicon.tableWords.select(SQLiteDatabaseLexicon.tableWordsColumnString).filter(
isSubsetOf(SQLiteDatabaseLexicon.tableWordsColumnString, Expression<String>(String(symbols)))
)
).map { $0[SQLiteDatabaseLexicon.tableWordsColumnString] }
os_log("LEXICON...Strings()→Database: %.2f seconds", log: LexiconLog, type: .debug, Date().timeIntervalSince(timing))
return strings
} catch {
os_log("FAULT...SQLite database content could not be accessed", log: LexiconLog, type: .fault)
}
}
return []
}
The error I get on the call to createFunction(), next to the block's parameters, is:
Contextual closure type '([Binding?]) -> Binding?' expects 1 argument, but 2 were used in closure body
The exact same code used to compile before I upgraded. Any help in solving this build issue is appreciated, thanks.