[jOOQ/jOOQ#7539] Support computed columns

This commit is contained in:
Lukas Eder 2024-04-02 12:39:20 +02:00
parent 0ac9d0eff5
commit ead3073334
3 changed files with 30 additions and 5 deletions

View File

@ -799,7 +799,7 @@ public interface DataType<T> extends Named {
* This feature is implemented in commercial distributions only.
*/
@NotNull
@Support({ DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
@Support({ CLICKHOUSE, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
DataType<T> generatedAlwaysAs(T generatedAlwaysAsValue);
/**
@ -811,7 +811,7 @@ public interface DataType<T> extends Named {
* This feature is implemented in commercial distributions only.
*/
@NotNull
@Support({ DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
@Support({ CLICKHOUSE, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
DataType<T> generatedAlwaysAs(Field<T> generatedAlwaysAsValue);
/**
@ -867,7 +867,7 @@ public interface DataType<T> extends Named {
* This feature is implemented in commercial distributions only.
*/
@NotNull
@Support({ DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
@Support({ CLICKHOUSE, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
DataType<T> stored();
/**
@ -879,7 +879,7 @@ public interface DataType<T> extends Named {
* This feature is implemented in commercial distributions only.
*/
@NotNull
@Support({ DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
@Support({ CLICKHOUSE, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
DataType<T> virtual();
/**
@ -890,7 +890,7 @@ public interface DataType<T> extends Named {
* This feature is implemented in commercial distributions only.
*/
@NotNull
@Support({ DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
@Support({ CLICKHOUSE, DERBY, DUCKDB, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
DataType<T> generationOption(GenerationOption generationOption);
/**

View File

@ -4990,6 +4990,22 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
}
else if (!computed && !ignoreProEdition() && parseKeywordIf("ALIAS") && requireProEdition()) {
}
else if (!computed && !ignoreProEdition() && parseKeywordIf("MATERIALIZED") && requireProEdition()) {
}
else if ((!identity || !computed) && parseKeywordIf("GENERATED")) {
boolean always;

View File

@ -141,6 +141,7 @@ import static org.jooq.impl.Identifiers.QUOTES;
import static org.jooq.impl.Identifiers.QUOTE_END_DELIMITER;
import static org.jooq.impl.Identifiers.QUOTE_END_DELIMITER_ESCAPED;
import static org.jooq.impl.Identifiers.QUOTE_START_DELIMITER;
import static org.jooq.impl.Keywords.K_ALIAS;
import static org.jooq.impl.Keywords.K_ALWAYS;
import static org.jooq.impl.Keywords.K_AS;
import static org.jooq.impl.Keywords.K_ATOMIC;
@ -176,6 +177,7 @@ import static org.jooq.impl.Keywords.K_IMPLICITLY;
import static org.jooq.impl.Keywords.K_INT;
import static org.jooq.impl.Keywords.K_INVISIBLE;
import static org.jooq.impl.Keywords.K_LIKE;
import static org.jooq.impl.Keywords.K_MATERIALIZED;
import static org.jooq.impl.Keywords.K_NOT;
import static org.jooq.impl.Keywords.K_NOT_NULL;
import static org.jooq.impl.Keywords.K_NULL;
@ -6129,6 +6131,13 @@ final class Tools {