Skip to content

Commit

Permalink
a fix for tuple 5
Browse files Browse the repository at this point in the history
  • Loading branch information
dileping committed Mar 26, 2017
1 parent 7d7c9dd commit 2e3123f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
28 changes: 9 additions & 19 deletions Sources/Demo/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,25 +173,15 @@ let comments = Comments()
print("Inserted shit:", ressult)
}*/

let q = comments.map { c in
(c.personId, c.comment)
}

let q123 = comments.filter { comment in
comment.comment ~= "%WTF%"
}.map { comment in
(comment.comment)
}.filter { c in
c ~= "%2%"
}

/*swirl.execute(q123 ?= "WTF2").onSuccess { r in
print("!!!!!!!!!!!!!!!!: \(r)")
}*/

q123.result.execute(in: swirl).onSuccess { comments in
for comment in comments {
print("!!!!!!!!!!!!!!!!: \(comment)")
comments.map { comment in
(comment.id, comment.personId, comment.comment)
}.filter { (_, _, comment) in
comment ~= "%WTF%"
}.map { (id, pid, _) in
(id, pid)
}.result.execute(in: swirl).onSuccess { items in
for (id, pid) in items {
print("id: \(id) is for \(pid)")
}
}

Expand Down
7 changes: 6 additions & 1 deletion Sources/Swirl/TupleRep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ extension Tuple4 : RepRichTuple {
}

extension Tuple5 : RepRichTuple {
public typealias ColumnsRep = Tuple3Rep<TypedColumn<A>, TypedColumn<B>, TypedColumn<C>>
public typealias ColumnsRep = Tuple5Rep<
TypedColumn<A>,
TypedColumn<B>,
TypedColumn<C>,
TypedColumn<D>,
TypedColumn<E>>

public static func columns(_ columns:ColumnsRep.Tuple.Wrapped) -> ColumnsRep {
return ColumnsRep(tuple: columns)
Expand Down

0 comments on commit 2e3123f

Please sign in to comment.