[jOOQ/jOOQ#9781] Add DSLContext.set(Name, Param<?>) for arbitrary set commands
This commit is contained in:
parent
c3b81e6324
commit
178d36d16e
@ -8513,6 +8513,14 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
RowCountQuery setSchema(Schema schema);
|
||||
|
||||
/**
|
||||
* Set a vendor specific flag to a new value.
|
||||
*
|
||||
* @see DSL#set(Name, Param)
|
||||
*/
|
||||
@Support({ MYSQL })
|
||||
RowCountQuery set(Name name, Param<?> param);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX DDL Statements
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@ -6588,6 +6588,16 @@ public class DSL {
|
||||
return dsl().setSchema(schema);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a vendor specific flag to a new value.
|
||||
*
|
||||
* @see DSLContext#set(Name, Param)
|
||||
*/
|
||||
@Support({ MYSQL })
|
||||
public static RowCountQuery set(Name name, Param<?> param) {
|
||||
return dsl().set(name, param);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX DDL Statements
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@ -2898,6 +2898,11 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
return new SetSchema(configuration(), schema);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RowCountQuery set(Name name, Param<?> param) {
|
||||
return new SetCommand(configuration(), name, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommentOnIsStep commentOnTable(String tableName) {
|
||||
return commentOnTable(name(tableName));
|
||||
|
||||
@ -2028,9 +2028,7 @@ final class ParserImpl implements Parser {
|
||||
// TODO: [#9780] Are there any possible syntaxes and data types?
|
||||
parseIf(ctx, '=');
|
||||
Object value = parseSignedIntegerIf(ctx);
|
||||
|
||||
// TODO: [#9781] Create public DSL API for this
|
||||
return new SetCommand(ctx.dsl.configuration(), name, value != null ? inline(value) : inline(parseStringLiteral(ctx)));
|
||||
return ctx.dsl.set(name, value != null ? inline(value) : inline(parseStringLiteral(ctx)));
|
||||
}
|
||||
|
||||
// There are many SET commands in programs like sqlplus, which we'll simply ignore
|
||||
|
||||
@ -49,7 +49,7 @@ import org.jooq.Param;
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
final class SetCommand extends AbstractQuery {
|
||||
final class SetCommand extends AbstractRowCountQuery {
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
|
||||
Loading…
Reference in New Issue
Block a user