[jOOQ/jOOQ#982] Add support for GIS extensions

- Added Geometry type
- Added support for ST_X, ST_Y, ST_GEOMFROMTEXT
- Added integration tests
This commit is contained in:
Lukas Eder 2021-11-10 17:04:02 +01:00
parent 24e68ea130
commit fc23a0cea7
8 changed files with 899 additions and 0 deletions

View File

@ -0,0 +1,120 @@
/*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;

View File

@ -213,6 +213,7 @@ import org.jooq.False;
import org.jooq.Field;
import org.jooq.FieldOrRow;
// ...
// ...
import org.jooq.GroupConcatOrderByStep;
import org.jooq.GroupConcatSeparatorStep;
import org.jooq.GroupField;
@ -20377,6 +20378,140 @@ public class DSL {
@ -26580,6 +26715,22 @@ public class DSL {
return value((Object) value, SQLDataType.XML);
}
/**
* A synonym for {@link #val(Object, Class)} to be used in Scala and Groovy,
* where <code>val</code> is a reserved keyword.
@ -27452,6 +27603,32 @@ public class DSL {
return inline((Object) value, SQLDataType.XML);
}
/**
* Create a bind value, that is always inlined.
* <p>
@ -27987,6 +28164,21 @@ public class DSL {
return val((Object) value, SQLDataType.XML);
}
/**
* Get a bind value with an associated type, taken from a field.
*

View File

@ -378,6 +378,9 @@ final class Names {
static final Name N_STRING_AGG = unquotedName("string_agg");
static final Name N_STRREVERSE = unquotedName("strreverse");
static final Name N_STR_REPLACE = unquotedName("str_replace");
static final Name N_ST_GEOMFROMTEXT = unquotedName("st_geomfromtext");
static final Name N_ST_X = unquotedName("st_x");
static final Name N_ST_Y = unquotedName("st_y");
static final Name N_SUB = unquotedName("sub");
static final Name N_SUBSTR = unquotedName("substr");
static final Name N_SUBSTRING = unquotedName("substring");

View File

@ -82,6 +82,7 @@ import org.jooq.Function6;
import org.jooq.Function7;
import org.jooq.Function8;
import org.jooq.Function9;
// ...
import org.jooq.GroupField;
import org.jooq.Index;
import org.jooq.Internal;
@ -3416,6 +3417,41 @@ public final class QOM {

View File

@ -87,6 +87,7 @@ import java.util.UUID;
import org.jooq.Configuration;
import org.jooq.DataType;
// ...
import org.jooq.JSON;
import org.jooq.JSONB;
import org.jooq.Record;
@ -707,6 +708,16 @@ public final class SQLDataType {
*/
public static final DataType<XML> XML = new DefaultDataType<>(null, XML.class, "xml");
// -------------------------------------------------------------------------
// Static initialisation of dialect-specific data types
// -------------------------------------------------------------------------

View File

@ -0,0 +1,199 @@
/*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;

View File

@ -0,0 +1,169 @@
/*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;

View File

@ -0,0 +1,169 @@
/*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;