[jOOQ/jOOQ#16875] Support BigQuery TIMESTAMP data type as SQLDataType.TIMESTAMPWITHTIMEZONE

This commit is contained in:
Lukas Eder 2024-07-01 20:01:26 +02:00
parent 391ee60937
commit d259aa6308

View File

@ -3461,6 +3461,13 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
static final class DefaultOffsetDateTimeBinding<U> extends InternalBinding<OffsetDateTime, U> {
DefaultOffsetDateTimeBinding(DataType<OffsetDateTime> dataType, Converter<OffsetDateTime, U> converter) {
super(dataType, converter);
}
@ -3544,6 +3551,12 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
final OffsetDateTime get0(BindingGetResultSetContext<U> ctx) throws SQLException {
if (!FALSE.equals(ctx.settings().isBindOffsetDateTimeType()))
return ctx.resultSet().getObject(ctx.index(), OffsetDateTime.class);
else
return OffsetDateTimeParser.offsetDateTime(ctx.resultSet().getString(ctx.index()));
}
@ -3552,6 +3565,12 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
final OffsetDateTime get0(BindingGetStatementContext<U> ctx) throws SQLException {
if (!FALSE.equals(ctx.settings().isBindOffsetDateTimeType()))
return ctx.statement().getObject(ctx.index(), OffsetDateTime.class);
else
return OffsetDateTimeParser.offsetDateTime(ctx.statement().getString(ctx.index()));
}
@ -3573,6 +3592,9 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
else
throw new UnsupportedOperationException("Type " + dataType + " is not supported");
}
@ -3591,6 +3613,9 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
// [#5779] Revert to encoding this type as string.
else
return Types.VARCHAR;