mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
README.md
This commit is contained in:
1 parent
999b98e1f0
commit
f2a8d91b5d
1 file changed
+6
-1
@@ -1113,10 +1113,15 @@ dbQueue.inDatabase { db in
|
||||
return nil
|
||||
}
|
||||
guard double >= 0.0 else {
|
||||
throw DatabaseError(message: "Invalid negative value")
|
||||
throw DatabaseError(message: "Invalid negative value in function sqrt()")
|
||||
}
|
||||
return sqrt(double)
|
||||
}
|
||||
db.addFunction(fn)
|
||||
|
||||
// fatal error: SQLite error 1 with statement `SELECT sqrt(-1)`:
|
||||
// Invalid negative value in function sqrt()
|
||||
Double.fetchOne(db, "SELECT sqrt(-1)")
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user