Skip to content

Commit c74ddea

Browse files
committed
Add support for aliasing columns
1 parent 385f435 commit c74ddea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SQLite/Typed/Expression.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ extension ExpressionType {
106106
" ".join([self, Expression<Void>(literal: "DESC")])
107107
}
108108

109+
public func alias(name:String) -> Expressible {
110+
return " ".join([self, Expression<Void>(literal: "AS \(name)")])
111+
}
109112
}
110113

111114
extension ExpressionType where UnderlyingType: Value {

0 commit comments

Comments
 (0)