mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
SE-0220 count(where:)
This commit is contained in:
1 parent
fa4febfa93
commit
493575a47b
1 file changed
+5
-1
@@ -299,7 +299,11 @@ extension Array where Element == TableAlias {
|
||||
for (lowercaseName, group) in groups {
|
||||
if group.count > 1 {
|
||||
// It is a programmer error to reuse the same alias for multiple tables
|
||||
#if compiler(>=5.0)
|
||||
GRDBPrecondition(group.count { $0.hasUserName } < 2, "ambiguous alias: \(group[0].identityName)")
|
||||
#else
|
||||
GRDBPrecondition(group.filter({ $0.hasUserName }).count < 2, "ambiguous alias: \(group[0].identityName)")
|
||||
#endif
|
||||
ambiguousGroups.append(group)
|
||||
} else {
|
||||
uniqueLowercaseNames.insert(lowercaseName)
|
||||
@@ -328,7 +332,7 @@ extension Array where Element == TableAlias {
|
||||
extension String {
|
||||
/// "bar" => "bar"
|
||||
/// "foo12" => "foo"
|
||||
var databaseQualifierRadical: String {
|
||||
fileprivate var databaseQualifierRadical: String {
|
||||
let digits: ClosedRange<Character> = "0"..."9"
|
||||
let radicalEndIndex = self // "foo12"
|
||||
.reversed() // "21oof"
|
||||
|
||||
Reference in new issue
Block a user