[#1350] Add support for the Vertica database
This commit is contained in:
parent
1b5cc6d638
commit
64022b4279
@ -5380,6 +5380,7 @@ public interface DSLContext extends Scope {
|
||||
* <li>{@link SQLDialect#SQLITE}: Using <code>last_insert_rowid()</code></li>
|
||||
* <li>{@link SQLDialect#SQLSERVER}: Using <code>@@identity</code></li>
|
||||
* <li>{@link SQLDialect#SYBASE}: Using <code>@@identity</code></li>
|
||||
* <li>{@link SQLDialect#VERTICA}: Using <code>last_insert_id()</code></li>
|
||||
* </ul>
|
||||
*
|
||||
* @return The last inserted ID. This may be <code>null</code> in some
|
||||
|
||||
@ -298,6 +298,7 @@ class AlterTableImpl extends AbstractQuery implements
|
||||
xxxxxx
|
||||
|
||||
xxxx xxxxxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxx
|
||||
xxxxxx
|
||||
xx [/pro] */
|
||||
@ -323,6 +324,7 @@ class AlterTableImpl extends AbstractQuery implements
|
||||
switch (family) {
|
||||
/* [pro] xx
|
||||
xxxx xxxx
|
||||
xxxx xxxxxxxx
|
||||
xxxxxxxxx xxxxxxxxxxxxxxx xxxx xxxxxxx
|
||||
xxxxxx
|
||||
xx [/pro] */
|
||||
|
||||
@ -79,7 +79,7 @@ class Concat extends AbstractFunction<String> {
|
||||
Field<String>[] others = new Field[cast.length - 1];
|
||||
System.arraycopy(cast, 1, others, 0, others.length);
|
||||
|
||||
switch (configuration.dialect().family()) {
|
||||
switch (configuration.family()) {
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
return function("concat", SQLDataType.VARCHAR, cast);
|
||||
|
||||
@ -51,7 +51,6 @@ import org.jooq.Configuration;
|
||||
import org.jooq.DatePart;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.QueryPart;
|
||||
import org.jooq.exception.SQLDialectNotSupportedException;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -272,8 +271,18 @@ class DateAdd<T extends java.util.Date> extends AbstractFunction<T> {
|
||||
x
|
||||
x
|
||||
|
||||
xxxx xxxxxxx x
|
||||
xxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxx xx xxx xxx xxxxxxxxxxxxxx
|
||||
xxxx xxxxxxxx x
|
||||
xxxxxx xxxxxxxxxx x
|
||||
xxxx xxxxx xxxxxxx x x xxxxxx xxxxxx
|
||||
xxxx xxxxxx xxxxxxx x x xxxxxxx xxxxxx
|
||||
xxxx xxxx xxxxxxx x x xxxxx xxxxxx
|
||||
xxxx xxxxx xxxxxxx x x xxxxxx xxxxxx
|
||||
xxxx xxxxxxx xxxxxxx x x xxxxxxxx xxxxxx
|
||||
xxxx xxxxxxx xxxxxxx x x xxxxxxxx xxxxxx
|
||||
xxxxxxxx xxxxxxxxxxxxxxxxxxx
|
||||
x
|
||||
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxxxx xx xxx xx xxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxxxxxxxxxx
|
||||
x
|
||||
xx [/pro] */
|
||||
}
|
||||
|
||||
@ -105,6 +105,7 @@ class DateDiff extends AbstractFunction<Integer> {
|
||||
xxxx xxxx
|
||||
xxxx xxxxxxxxxx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx
|
||||
|
||||
xxxx xxxx
|
||||
|
||||
@ -1886,6 +1886,10 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri
|
||||
return select(field).fetchOne(field);
|
||||
}
|
||||
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
|
||||
case CUBRID:
|
||||
case MARIADB:
|
||||
case MYSQL: {
|
||||
|
||||
@ -77,6 +77,7 @@ class Euler extends AbstractFunction<BigDecimal> {
|
||||
xxxx xxxxxxxxx
|
||||
xxxx xxxxxxxxxx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
case CUBRID:
|
||||
case DERBY:
|
||||
|
||||
@ -107,6 +107,13 @@ class LeadLag<T> extends Function<T> {
|
||||
xxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxx
|
||||
xxxxxx
|
||||
|
||||
xx xx xxxxxxxx xxx xxxxxxxxxxxx xxxx xx x xxxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxx
|
||||
|
||||
xx [/pro] */
|
||||
|
||||
default:
|
||||
|
||||
@ -78,6 +78,33 @@ class Limit extends AbstractQueryPart {
|
||||
|
||||
// True LIMIT / OFFSET support provided by the following dialects
|
||||
// -----------------------------------------------------------------
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxxx x
|
||||
|
||||
xx xxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxxxx x xx xxxxx x xxxxxx xx xxx xxxxxxxxx xxx xxxxxxxxxxx
|
||||
xx xx xxxxxxx xxxx xxxxxxx xxxxxxx xxxxxxx xxxxxxxxxxx xx xxxxx xx xxxxxx
|
||||
xx xxxxxxx xx xxxxxxx xxxxxx xx xxxxxxx xxxxxxx
|
||||
xx xxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xxxxxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxx
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xx xxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxx xxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xx xxxxxxxxxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xxxxxx
|
||||
x
|
||||
xx [/pro] */
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL:
|
||||
case H2:
|
||||
|
||||
@ -939,7 +939,7 @@ implements
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Return a standard MERGE statement simulating the H2-specific syntax
|
||||
* Return a standard MERGE statement emulating the H2-specific syntax
|
||||
*/
|
||||
private final QueryPart getStandardMerge(Configuration config) {
|
||||
switch (config.dialect().family()) {
|
||||
@ -949,6 +949,7 @@ implements
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxxxx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
case CUBRID:
|
||||
case HSQLDB: {
|
||||
|
||||
@ -109,7 +109,8 @@ class RegexpLike extends AbstractCondition {
|
||||
|
||||
/* [pro] xx
|
||||
xx xxxxxx xxxxxx xxx xxx xxx xxxxxx
|
||||
xxxx xxxxxxx x
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxx x
|
||||
|
||||
xx xxxxxxx xxxxx xxxxxxx xxxx xx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxx xxxxxxxxxx
|
||||
|
||||
@ -83,6 +83,7 @@ class Replace extends AbstractFunction<String> {
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxxxx
|
||||
xxxx xxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
case FIREBIRD:
|
||||
case HSQLDB:
|
||||
|
||||
90
jOOQ/src/main/java/org/jooq/impl/SQLInline.java
Normal file
90
jOOQ/src/main/java/org/jooq/impl/SQLInline.java
Normal file
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This work is dual-licensed
|
||||
* - under the Apache Software License 2.0 (the "ASL")
|
||||
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
|
||||
* =============================================================================
|
||||
* You may choose which license applies to you:
|
||||
*
|
||||
* - If you're using this work with Open Source databases, you may choose
|
||||
* either ASL or jOOQ License.
|
||||
* - If you're using this work with at least one commercial database, you must
|
||||
* choose jOOQ License
|
||||
*
|
||||
* For more information, please visit http://www.jooq.org/licenses
|
||||
*
|
||||
* Apache Software License 2.0:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* jOOQ License and Maintenance Agreement:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Data Geekery grants the Customer the non-exclusive, timely limited and
|
||||
* non-transferable license to install and use the Software under the terms of
|
||||
* the jOOQ License and Maintenance Agreement.
|
||||
*
|
||||
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
|
||||
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.conf.ParamType.INLINED;
|
||||
import static org.jooq.impl.DSL.sql;
|
||||
|
||||
import org.jooq.Clause;
|
||||
import org.jooq.Context;
|
||||
import org.jooq.QueryPart;
|
||||
import org.jooq.SQL;
|
||||
import org.jooq.conf.ParamType;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
class SQLInline extends AbstractQueryPart implements SQL {
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = 5352233054249655126L;
|
||||
|
||||
private SQL sql;
|
||||
|
||||
SQLInline(QueryPart part) {
|
||||
this(sql("{0}", part));
|
||||
}
|
||||
|
||||
SQLInline(SQL sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
ParamType paramType = ctx.paramType();
|
||||
|
||||
ctx.paramType(INLINED)
|
||||
.visit(sql)
|
||||
.paramType(paramType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Clause[] clauses(Context<?> ctx) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return sql.toString();
|
||||
}
|
||||
}
|
||||
@ -591,7 +591,7 @@ class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> implement
|
||||
/* [pro] xx
|
||||
xx xxxx xxxxxxx
|
||||
xx xxxxxxxxxxxx
|
||||
xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x
|
||||
xx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx x
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
xxxxxxxx xxxxxxxxxx x xxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
@ -115,6 +115,10 @@ class TimestampDiff extends AbstractFunction<DayToSecond> {
|
||||
case DERBY:
|
||||
return (Field) field("1000 * {fn {timestampdiff}({sql_tsi_second}, {0}, {1}) }", INTEGER, timestamp2, timestamp1);
|
||||
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
|
||||
case FIREBIRD:
|
||||
return field("{datediff}(millisecond, {0}, {1})", getDataType(), timestamp2, timestamp1);
|
||||
|
||||
|
||||
@ -124,6 +124,7 @@ class TruncDate<T extends java.util.Date> extends AbstractFunction<T> {
|
||||
|
||||
/* [pro] xx
|
||||
xxxx xxxxxxxxx
|
||||
xxxx xxxxxxxx
|
||||
xx [/pro] */
|
||||
|
||||
case POSTGRES: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user