[#7087] Support USE for SET SCHEMA in Derby and HSQLDB
This commit is contained in:
parent
cbfd3bb6ee
commit
0e12b3fa6e
@ -171,7 +171,10 @@ renameStatement = 'RENAME'
|
||||
setCatalogStatement = 'SET CATALOG' catalogName
|
||||
;
|
||||
|
||||
setSchemaStatement = 'SET SCHEMA' schemaName
|
||||
setSchemaStatement = 'SET' (
|
||||
[ 'CURRENT' ] 'SCHEMA'
|
||||
| 'CURRENT SQLID'
|
||||
) [ '=' ] ( schemaName | stringLiteral )
|
||||
;
|
||||
|
||||
useStatement = 'USE' ( catalogName | schemaName )
|
||||
|
||||
@ -8488,7 +8488,7 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
*
|
||||
* @see DSL#schema(Name)
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Query setSchema(String schema);
|
||||
|
||||
/**
|
||||
@ -8496,13 +8496,13 @@ public interface DSLContext extends Scope , AutoCloseable {
|
||||
*
|
||||
* @see DSL#schema(Name)
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Query setSchema(Name schema);
|
||||
|
||||
/**
|
||||
* Set the current schema to a new value.
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Query setSchema(Schema schema);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@ -6648,7 +6648,7 @@ public class DSL {
|
||||
*
|
||||
* @see DSL#schema(Name)
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
public static Query setSchema(String schema) {
|
||||
return dsl().setSchema(schema);
|
||||
}
|
||||
@ -6658,7 +6658,7 @@ public class DSL {
|
||||
*
|
||||
* @see DSL#schema(Name)
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
public static Query setSchema(Name schema) {
|
||||
return dsl().setSchema(schema);
|
||||
}
|
||||
@ -6666,7 +6666,7 @@ public class DSL {
|
||||
/**
|
||||
* Set the current schema to a new value.
|
||||
*/
|
||||
@Support({ H2, MARIADB, MYSQL, POSTGRES} )
|
||||
@Support({ DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
public static Query setSchema(Schema schema) {
|
||||
return dsl().setSchema(schema);
|
||||
}
|
||||
|
||||
@ -1249,6 +1249,10 @@ final class ParserImpl implements Parser {
|
||||
|
||||
if (parseKeywordIf(ctx, "CATALOG"))
|
||||
return parseSetCatalog(ctx);
|
||||
else if (parseKeywordIf(ctx, "CURRENT SCHEMA"))
|
||||
return parseSetSchema(ctx);
|
||||
else if (parseKeywordIf(ctx, "CURRENT SQLID"))
|
||||
return parseSetSchema(ctx);
|
||||
else if (parseKeywordIf(ctx, "GENERATOR"))
|
||||
return parseSetGenerator(ctx);
|
||||
else if (parseKeywordIf(ctx, "SCHEMA"))
|
||||
@ -1271,6 +1275,7 @@ final class ParserImpl implements Parser {
|
||||
}
|
||||
|
||||
private static final Query parseSetSchema(ParserContext ctx) {
|
||||
parseIf(ctx, '=');
|
||||
return ctx.dsl.setSchema(parseSchemaName(ctx));
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,9 @@ final class SetSchema extends AbstractQuery {
|
||||
ctx.visit(K_USE).sql(' ').visit(schema);
|
||||
break;
|
||||
|
||||
case DERBY:
|
||||
case H2:
|
||||
case HSQLDB:
|
||||
case POSTGRES:
|
||||
default:
|
||||
ctx.visit(K_SET).sql(' ').visit(K_SCHEMA).sql(' ').visit(schema);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user