mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Merge branch 'master' of github.com:groue/GRDB.swift into FetchedRecordsController
This commit is contained in:
commit
d2339cc7c2
1 file changed
+2
-1
@@ -1171,10 +1171,11 @@ let reverseString = DatabaseFunction(
|
||||
argumentCount: 1, // Number of arguments
|
||||
pure: true, // True means that the result only depends on input
|
||||
function: { (databaseValues: [DatabaseValue]) in
|
||||
// Extract string value, if any...
|
||||
guard let string: String = databaseValues[0].value() else {
|
||||
// Not a string argument: return NULL
|
||||
return nil
|
||||
}
|
||||
// ... and return reversed string:
|
||||
return String(string.characters.reverse())
|
||||
})
|
||||
dbQueue.addFunction(reverseString) // Or dbPool.addFunction(...)
|
||||
|
||||
Reference in new issue
Block a user