[jOOQ/jOOQ#8760] [jOOQ/jOOQ#7518] Parse TIMESTAMPDIFF()
The parser now supports parsing the TIMESTAMPDIFF() function, which is mapped to DSL#timestampDiff().
This commit is contained in:
parent
a1c54350a5
commit
bb871723a7
@ -5743,6 +5743,8 @@ final class ParserImpl implements Parser {
|
||||
return field;
|
||||
else if ((field = parseFieldToTimestampIf(ctx)) != null)
|
||||
return field;
|
||||
else if ((field = parseFieldTimestampDiffIf(ctx)) != null)
|
||||
return field;
|
||||
|
||||
if (N.is(type) || D.is(type))
|
||||
if ((field = parseFieldTruncIf(ctx)) != null)
|
||||
@ -7065,6 +7067,20 @@ final class ParserImpl implements Parser {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final Field<?> parseFieldTimestampDiffIf(ParserContext ctx) {
|
||||
if (parseFunctionNameIf(ctx, "TIMESTAMPDIFF")) {
|
||||
parse(ctx, '(');
|
||||
Field<Timestamp> ts1 = (Field<Timestamp>) parseField(ctx, Type.D);
|
||||
parse(ctx, ',');
|
||||
Field<Timestamp> ts2 = (Field<Timestamp>) parseField(ctx, Type.D);
|
||||
parse(ctx, ')');
|
||||
|
||||
return DSL.timestampDiff(ts1, ts2);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final Field<?> parseFieldRtrimIf(ParserContext ctx) {
|
||||
if (parseFunctionNameIf(ctx, "RTRIM")) {
|
||||
parse(ctx, '(');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user