[jOOQ/jOOQ#2620] BigQuery support (WIP)

- Generate correct view sources
- Query INFORMATION_SCHEMA.TABLES and COLUMNS directly
- Add array type support in code generator
- Re-generated code
- Updated code generation configuration
This commit is contained in:
Lukas Eder 2021-05-24 12:29:55 +02:00
parent b0085fdb98
commit c52b01f8c5
2 changed files with 17 additions and 2 deletions

View File

@ -48,6 +48,7 @@ import static org.jooq.impl.DSL.name;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jooq.Name;
@ -65,6 +66,9 @@ class GenerationUtil {
static final Pattern PLAIN_GENERIC_TYPE_PATTERN = Pattern.compile("[<\\[]((?:[\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*)[>\\]]");
static final Pattern UNDERSCORE_PATTERN = Pattern.compile("_+");
private static final Set<String> JAVA_KEYWORDS = unmodifiableSet(new HashSet<>(asList(
"abstract",
"assert",
@ -468,9 +472,8 @@ class GenerationUtil {
* @see Class#getSimpleName()
*/
static String getSimpleJavaType(String qualifiedJavaType) {
if (qualifiedJavaType == null) {
if (qualifiedJavaType == null)
return null;
}
return qualifiedJavaType.replaceAll(".*\\.", "");
}
@ -491,6 +494,15 @@ class GenerationUtil {
case POSTGRES: {
// The convention is to prepend a "_" to a type to get an array type

View File

@ -2740,6 +2740,9 @@ public abstract class AbstractDatabase implements Database {
case POSTGRES:
case H2:
return "ARRAY".equals(dataType);