forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostgresAlias.java
More file actions
35 lines (26 loc) · 763 Bytes
/
PostgresAlias.java
File metadata and controls
35 lines (26 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package sqlancer.postgres.ast;
import sqlancer.common.visitor.UnaryOperation;
public class PostgresAlias implements UnaryOperation<PostgresExpression>, PostgresExpression {
private final PostgresExpression expr;
private final String alias;
public PostgresAlias(PostgresExpression expr, String alias) {
this.expr = expr;
this.alias = alias;
}
@Override
public PostgresExpression getExpression() {
return expr;
}
@Override
public String getOperatorRepresentation() {
return " as " + alias;
}
@Override
public OperatorKind getOperatorKind() {
return OperatorKind.POSTFIX;
}
@Override
public boolean omitBracketsWhenPrinting() {
return true;
}
}