boolean canCombineArrays() { if (canCombineArrays == null) { // [#7270] The ARRAY && ARRAY operator is not implemented in all PostgreSQL // style databases, e.g. CockroachDB try { create(true).select(field("array[1, 2] && array[2, 3]")).fetch(); canCombineArrays = true; } catch (DataAccessException e) { canCombineArrays = false; } } return canCombineArrays; }
boolean canUseTupleInPredicates() { if (canUseTupleInPredicates == null) { // [#7270] The tuple in predicate is not implemented in all PostgreSQL // style databases, e.g. CockroachDB // [#8072] Some database versions might support in, but not not in try { create(true).select(field("(1, 2) in (select 1, 2)")).fetch(); create(true).select(field("(1, 2) not in (select 1, 2)")).fetch(); canUseTupleInPredicates = true; } catch (DataAccessException e) { canUseTupleInPredicates = false; } } return canUseTupleInPredicates; }
@Override public void start(ExecuteContext ctx) { // [#4974] Prevent any class loading effects from impacting below // SQLPerformanceWarning. if (!initialised) { try { DSL.using(configuration).selectOne().fetch(); } // [#7248] Unsupported dialects might not be able to run queries on the DUAL table catch (DataAccessException ignore) { log.debug("Error while running init query", ignore); } initialised = true; } }
boolean is84() { if (is84 == null) { // [#2916] Window functions were introduced with PostgreSQL 9.0 try { create(true) .select(count().over()) .fetch(); is84 = true; } catch (DataAccessException e) { is84 = false; } } return is84; }