[jOOQ/jOOQ#15307] Emulate CREATE SCHEMA with CREATE USER .. NO AUTHENTICATION in Oracle 18c

This commit is contained in:
Lukas Eder 2023-06-29 12:39:22 +02:00
parent 2f8c92314a
commit c34b4249c4
4 changed files with 36 additions and 2 deletions

View File

@ -101,6 +101,10 @@ implements
private final boolean supportsIfNotExists(Context<?> ctx) {
return !NO_SUPPORT_IF_NOT_EXISTS.contains(ctx.dialect());
}
@ -157,13 +161,25 @@ implements
ctx.sql(' ').visit(K_SCHEMA);
if (ifNotExists && supportsIfNotExists(ctx))
ctx.sql(' ').visit(K_IF_NOT_EXISTS);
ctx.sql(' ').visit(schema)
.end(Clause.CREATE_SCHEMA_NAME);
ctx.sql(' ').visit(schema);
ctx.end(Clause.CREATE_SCHEMA_NAME);
}
@Override

View File

@ -135,6 +135,10 @@ implements
private final boolean supportsIfExists(Context<?> ctx) {
return !NO_SUPPORT_IF_EXISTS.contains(ctx.dialect());
}
@ -174,6 +178,8 @@ implements
ctx.sql(' ').visit(K_SCHEMA);
if (ifExists && supportsIfExists(ctx))
@ -183,6 +189,9 @@ implements
if (cascade == Cascade.CASCADE)
ctx.sql(' ').visit(K_CASCADE);
else if (cascade == Cascade.RESTRICT || REQUIRES_RESTRICT.contains(ctx.dialect()))
ctx.sql(' ').visit(K_RESTRICT);

View File

@ -66,6 +66,7 @@ final class Keywords {
static final Keyword K_AS = keyword("as");
static final Keyword K_AS_OF = keyword("as of");
static final Keyword K_ATOMIC = keyword("atomic");
static final Keyword K_AUTHENTICATION = keyword("authentication");
static final Keyword K_AUTO = keyword("auto");
static final Keyword K_AUTOINCREMENT = keyword("autoincrement");
static final Keyword K_AUTO_INCREMENT = keyword("auto_increment");
@ -329,6 +330,7 @@ final class Keywords {
static final Keyword K_PUBLIC = keyword("public");
static final Keyword K_QUALIFY = keyword("qualify");
static final Keyword K_QUERY = keyword("query");
static final Keyword K_QUOTA = keyword("quota");
static final Keyword K_RAISE = keyword("raise");
static final Keyword K_RAISERROR = keyword("raiserror");
static final Keyword K_RAW = keyword("raw");
@ -428,12 +430,15 @@ final class Keywords {
static final Keyword K_UNBOUNDED_FOLLOWING = keyword("unbounded following");
static final Keyword K_UNBOUNDED_PRECEDING = keyword("unbounded preceding");
static final Keyword K_UNIQUE = keyword("unique");
static final Keyword K_UNLIMITED = keyword("unlimited");
static final Keyword K_UNNEST = keyword("unnest");
static final Keyword K_UNTIL = keyword("until");
static final Keyword K_UPDATE = keyword("update");
static final Keyword K_UPDLOCK = keyword("updlock");
static final Keyword K_UPSERT = keyword("upsert");
static final Keyword K_USE = keyword("use");
static final Keyword K_USER = keyword("user");
static final Keyword K_USERS = keyword("users");
static final Keyword K_USING = keyword("using");
static final Keyword K_USING_INDEX = keyword("using index");
static final Keyword K_VALUE = keyword("value");

View File

@ -5499,6 +5499,10 @@ final class Tools {