From 8cc13ba0bd27b9d05347b37edba7c8e18c05c784 Mon Sep 17 00:00:00 2001 From: Rostyslav Kobyzskyi Date: Thu, 31 Oct 2024 17:50:56 -0700 Subject: [PATCH] add as alias --- Sources/SQLite/Typed/Expression.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/SQLite/Typed/Expression.swift b/Sources/SQLite/Typed/Expression.swift index dcc44fe4..7da60e97 100644 --- a/Sources/SQLite/Typed/Expression.swift +++ b/Sources/SQLite/Typed/Expression.swift @@ -105,6 +105,10 @@ extension ExpressionType { " ".join([self, Expression(literal: "DESC")]) } + public func `as`(_ name: String) -> Expressible { + " ".join([self, Expression(literal: "AS \(name)")]) + } + } extension ExpressionType where UnderlyingType: Value {