Module: Sequel::SQL::AliasMethods

Included in:
Dataset, LiteralString, Postgres::HStore, Postgres::JSONArray, Postgres::JSONHash, Postgres::PGArray, Postgres::PGRange, Postgres::PGRow::ArrayRow, Postgres::PGRow::HashRow, Blob, ComplexExpression, GenericExpression, String, Symbol
Defined in:
lib/sequel/sql.rb

Overview

Includes an as method that creates an SQL alias.

Instance Method Summary (collapse)

Instance Method Details

- (Object) as(aliaz)

Create an SQL alias (AliasedExpression) of the receiving column or expression to the given alias.

Sequel.function(:func).as(:alias) # func() AS "alias"


254
255
256
# File 'lib/sequel/sql.rb', line 254

def as(aliaz)
  AliasedExpression.new(self, aliaz)
end