[#6986] Emulate COMMENT ON in SQL Server using sp_updateextendedproperty
This commit is contained in:
parent
39977aaa5b
commit
7adbd3ab0a
@ -45,6 +45,7 @@ import static org.jooq.SQLDialect.MARIADB;
|
||||
import static org.jooq.SQLDialect.MYSQL;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
|
||||
/**
|
||||
* The step in the <code>COMMENT ON [ object type ]</code> statement where the
|
||||
|
||||
@ -38,9 +38,17 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.comment;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.Keywords.K_ALTER_TABLE;
|
||||
import static org.jooq.impl.Keywords.K_BEGIN_CATCH;
|
||||
import static org.jooq.impl.Keywords.K_BEGIN_TRY;
|
||||
import static org.jooq.impl.Keywords.K_COLUMN;
|
||||
import static org.jooq.impl.Keywords.K_COMMENT;
|
||||
import static org.jooq.impl.Keywords.K_DECLARE;
|
||||
import static org.jooq.impl.Keywords.K_DEFAULT;
|
||||
import static org.jooq.impl.Keywords.K_END_CATCH;
|
||||
import static org.jooq.impl.Keywords.K_END_TRY;
|
||||
import static org.jooq.impl.Keywords.K_EXEC;
|
||||
import static org.jooq.impl.Keywords.K_IS;
|
||||
import static org.jooq.impl.Keywords.K_ON;
|
||||
import static org.jooq.impl.Keywords.K_TABLE;
|
||||
@ -52,6 +60,7 @@ import org.jooq.CommentOnIsStep;
|
||||
import org.jooq.Configuration;
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Table;
|
||||
|
||||
/**
|
||||
@ -88,6 +97,12 @@ implements
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL: {
|
||||
if (table != null)
|
||||
@ -105,6 +120,45 @@ implements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private final void acceptMySQL(Context<?> ctx) {
|
||||
ctx.visit(K_ALTER_TABLE).sql(' ').visit(table).sql(' ').visit(K_COMMENT).sql(" = ").visit(comment);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user