-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathPostgresOrderByTerm.java
More file actions
42 lines (31 loc) · 936 Bytes
/
PostgresOrderByTerm.java
File metadata and controls
42 lines (31 loc) · 936 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
36
37
38
39
40
41
42
package sqlancer.postgres.ast;
import sqlancer.Randomly;
import sqlancer.postgres.PostgresSchema.PostgresDataType;
public class PostgresOrderByTerm implements PostgresExpression {
private final PostgresOrder order;
private final PostgresExpression expr;
public enum PostgresOrder {
ASC, DESC;
public static PostgresOrder getRandomOrder() {
return Randomly.fromOptions(PostgresOrder.values());
}
}
public PostgresOrderByTerm(PostgresExpression expr, PostgresOrder order) {
this.expr = expr;
this.order = order;
}
public PostgresOrder getOrder() {
return order;
}
public PostgresExpression getExpr() {
return expr;
}
@Override
public PostgresConstant getExpectedValue() {
throw new AssertionError(this);
}
@Override
public PostgresDataType getExpressionType() {
return null;
}
}