[jOOQ/jOOQ#17495] Add useParsingConnection property to LiquibaseDatabase and JPADatabase
This includes: - [jOOQ/jOOQ#17496] Implement ParsingStatement::getWarnings and and ParsingStatement::clearWarnings
This commit is contained in:
parent
b831e131be
commit
fc79af2323
@ -50,6 +50,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.TableDefinition;
|
||||
import org.jooq.meta.extensions.AbstractInterpretingDatabase;
|
||||
import org.jooq.tools.Convert;
|
||||
|
||||
@ -45,6 +45,9 @@ import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.conf.ParseUnknownFunctions;
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.exception.DataAccessException;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.meta.SchemaDefinition;
|
||||
@ -90,6 +93,7 @@ public abstract class AbstractInterpretingDatabase extends H2Database {
|
||||
if (connection == null) {
|
||||
try {
|
||||
String unqualifiedSchema = getProperties().getProperty("unqualifiedSchema", "none").toLowerCase();
|
||||
|
||||
publicIsDefault = "none".equals(unqualifiedSchema);
|
||||
|
||||
Properties info = new Properties();
|
||||
@ -97,6 +101,12 @@ public abstract class AbstractInterpretingDatabase extends H2Database {
|
||||
info.put("password", "");
|
||||
connection = new org.h2.Driver().connect("jdbc:h2:mem:jooq-meta-extensions-" + UUID.randomUUID(), info);
|
||||
|
||||
if (Boolean.parseBoolean(getProperties().getProperty("useParsingConnection")))
|
||||
connection = DSL
|
||||
.using(connection, SQLDialect.H2, new Settings()
|
||||
.withParseUnknownFunctions(ParseUnknownFunctions.IGNORE))
|
||||
.parsingConnection();
|
||||
|
||||
export();
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
@ -261,6 +261,16 @@ final class ParsingStatement implements CallableStatement {
|
||||
return statement().getResultSetHoldability();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLWarning getWarnings() throws SQLException {
|
||||
return statement().getWarnings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clearWarnings() throws SQLException {
|
||||
statement().clearWarnings();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: Static statement execution
|
||||
// -------------------------------------------------------------------------
|
||||
@ -1434,16 +1444,6 @@ final class ParsingStatement implements CallableStatement {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SQLWarning getWarnings() throws SQLException {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void clearWarnings() throws SQLException {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void closeOnCompletion() throws SQLException {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user