Skip to content

Commit

Permalink
feat: expose isStored on column (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurminder71 authored Oct 9, 2024
1 parent 0b31312 commit fe7fc2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public boolean isHidden() {
return AstTreeUtils.getOptionalChildByType(children, ASThidden.class) != null;
}

public boolean isStored() {
return getGenerationClause() != null && getGenerationClause().isStored();
}

@Override
public String toString() {
// check for unknown/unsupported children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ public ASTgeneration_clause(DdlParser p, int id) {
super(p, id);
}

public boolean isStored() {
return children.length > 1 && children[1].getClass() == ASTstored.class;
}

@Override
public String toString() {
final ASTexpression exp = (ASTexpression) children[0];
final String storedOpt =
children.length > 1 && children[1].getClass() == ASTstored.class ? " STORED" : "";
final String storedOpt = isStored() ? " STORED" : "";
return "AS ( " + exp.toString() + " )" + storedOpt;
}

Expand Down

0 comments on commit fe7fc2a

Please sign in to comment.