Query vs. DML vs DDL #1290
manticore-projects
started this conversation in
Ideas
Replies: 3 comments
-
Wouldn't it be sufficient to introduce some kind of grouping interfaces? What should be within the abstract base clases? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Quick and dirty draft for discussion: public abstract class StatementImpl implements Statement {
abstract StringBuilder appendTo(StringBuilder builder);
@Override
public String toString() {
return appendTo(new StringBuilder()).toString();
}
}
public abstract class DDLStatement extends StatementImpl {
}
public abstract class DMLStatement extends StatementImpl {
}
public abstract class QueryStatement extends StatementImpl {
} And then every Statement class should extend one of these, like: public class Select extends QueryStatement {
....
}
public class Insert extends DMLStatement {
....
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Solved via PR #1301 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings.
At the moment all Statements just extend
Statement
and we do not know if the Statement is a Query, a DML or a DDL (unless we test a lot ofinstance of
).I would like to suggest to
a) either introduce new Abstract Classes
QueryStatement
,DmlStatement' and
DdlStatementuse these (instead of
Statement) for implementing each Statement b) or to declare
Statementabstract with additional methods
getStatementType()(returning
Query,
DDLor
DML) and
isQuery(),
isDml()and
isDdl()`Which way would be preferred? I tended to option a).
Beta Was this translation helpful? Give feedback.
All reactions