Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and adjustments for the Oracle provider #1410

Merged
merged 41 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c41882b
Added support for table synonyms
Oct 20, 2023
7ba18ba
Added new parameters to query and manipulator call
Oct 20, 2023
7645a94
Changed error types
Oct 20, 2023
ed72624
Mount volumes to oracle container
Oct 20, 2023
875d4e7
workflow part 2
Oct 20, 2023
00715c6
workflow part 3
Oct 20, 2023
f90d735
workflow part 4
Oct 20, 2023
31b3189
Changed file permissions to 777
Oct 25, 2023
befb4c2
Deleted folder
Oct 25, 2023
24cc032
Recreated folder
Oct 25, 2023
ed980ae
Merge branch 'geopython:master' into develop
xkosubek Oct 25, 2023
64cda6c
Changed to official Oracle Docker-Image
Oct 25, 2023
dac7844
Merge branch 'develop' of https://github.com/xkosubek/pygeoapi into d…
Oct 25, 2023
772d82a
Added Chown user
Oct 25, 2023
aee3321
back to gvenzl/oracle-xe:latest
Oct 25, 2023
bdc32b1
Tried docker-entrypoint-startdb.d
Oct 25, 2023
8274f53
Added addnab/docker-run-action@v3
Oct 25, 2023
207a784
Added port and deamon mode
Oct 25, 2023
79e501a
next try
Oct 25, 2023
ea8b9a2
added job.container.network
Oct 25, 2023
4463a1b
next try
Oct 25, 2023
3e2d271
+ docker ps
Oct 25, 2023
0daf024
next try
Oct 25, 2023
0234c8a
using docker run
Oct 25, 2023
3d8ecf4
next try
Oct 25, 2023
8a64168
next try
Oct 25, 2023
8637be5
Changed len of array to 11
Oct 25, 2023
ae5e2ab
Merge branch 'geopython:master' into develop
xkosubek Nov 7, 2023
38a6e8b
Use sdo_util.from_geojsonfor create and update
Nov 8, 2023
1bc6223
Flake8 changes
Nov 8, 2023
f30b53a
Fixed error with views
Nov 8, 2023
45a18cb
Merge branch 'geopython:master' into develop
xkosubek Nov 21, 2023
34b18d8
Added crs_transform_spec support
Nov 21, 2023
15c26f9
Merge branch 'develop' of https://github.com/xkosubek/pygeoapi into d…
Nov 21, 2023
809d224
Without default_crs
Nov 22, 2023
58343ce
Updated documentation for Oracle Provider
Nov 22, 2023
98ba17a
changes for flake8
Nov 22, 2023
1fd3eac
Added crs_transform_spec support to get function
Nov 22, 2023
e2a8818
review changes
Nov 23, 2023
fd21e9e
Added configurable SDO operator
Nov 29, 2023
8224dd1
Merge branch 'geopython:master' into develop
xkosubek Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,10 @@ jobs:
env:
PYGEOAPI_CONFIG: "$(pwd)/pygeoapi-config.yml"

services:
# Oracle service (label used to access the service container)
oracle:
# Docker Hub image (feel free to change the tag "latest" to any other available one)
image: gvenzl/oracle-xe:latest
# Provide passwords and other environment variables to container
env:
ORACLE_RANDOM_PASSWORD: true
APP_USER: geo_test
APP_USER_PASSWORD: geo_test
# Forward Oracle port
ports:
- 1521:1521
# Provide healthcheck script options for startup
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10

steps:
- name: Chown user
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Setup Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -105,6 +88,9 @@ jobs:
with:
packages: gdal-bin libgdal-dev
version: 3.0.4
- name: Install and run Oracle
run: |
docker run -d --name oracledb -e ORACLE_PWD=oracle -v ${{ github.workspace }}/tests/data/oracle/init-db:/opt/oracle/scripts/startup -p 1521:1521 container-registry.oracle.com/database/express:21.3.0-xe
- name: Install requirements 📦
run: |
pip3 install -r requirements.txt
Expand All @@ -125,6 +111,7 @@ jobs:
python3 tests/load_mongo_data.py tests/data/ne_110m_populated_places_simple.geojson
gunzip < tests/data/hotosm_bdi_waterways.sql.gz | psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_data.sql
docker ps
python3 tests/load_oracle_data.py
- name: run unit tests ⚙️
env:
Expand Down
64 changes: 55 additions & 9 deletions docs/source/data-publishing/ogcapi-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ parameters.
`GeoJSON`_,✅/✅,results/hits,❌,❌,❌,✅,❌,❌,✅
`MongoDB`_,✅/❌,results,✅,✅,✅,✅,❌,❌,✅
`OGR`_,✅/❌,results/hits,✅,❌,❌,✅,❌,❌,✅
`Oracle`_,✅/✅,results/hits,✅,❌,✅,✅,❌,❌,✅
`PostgreSQL`_,✅/✅,results/hits,✅,✅,✅,✅,✅,❌,✅
`SQLiteGPKG`_,✅/❌,results/hits,✅,❌,❌,✅,❌,❌,✅
`SensorThings API`_,✅/✅,results/hits,✅,✅,✅,✅,❌,❌,✅
Expand Down Expand Up @@ -274,6 +275,8 @@ Oracle
.. note::
Requires Python package oracledb

Connection
""""""""""
.. code-block:: yaml

providers:
Expand All @@ -295,21 +298,64 @@ Oracle
table: lakes
geom_field: geometry
title_field: name
# sql_manipulator: tests.test_oracle_provider.SqlManipulator
# sql_manipulator_options:
# foo: bar
# mandatory_properties:
# - bbox
# source_crs: 31287 # defaults to 4326 if not provided
# target_crs: 31287 # defaults to 4326 if not provided

The provider supports connection over host and port with SID or SERVICE_NAME. For TNS naming, the system

The provider supports connection over host and port with SID, SERVICE_NAME or TNS_NAME. For TNS naming, the system
environment variable TNS_ADMIN or the configuration parameter tns_admin must be set.

The providers supports external authentication. At the moment only wallet authentication is implemented.

Sometimes it is necessary to use the Oracle client for the connection. In this case init_oracle_client must be set to True.

SDO options
"""""""""""
.. code-block:: yaml

providers:
- type: feature
name: OracleDB
data:
host: 127.0.0.1
port: 1521
service_name: XEPDB1
user: geo_test
password: geo_test
id_field: id
table: lakes
geom_field: geometry
title_field: name
sdo_operator: sdo_relate # defaults to sdo_filter
sdo_param: mask=touch+coveredby # defaults to mask=anyinteract

The provider supports two different SDO operators, sdo_filter and sdo_relate. When not set, the default is sdo_relate!
Further more it is possible to set the sdo_param option. When sdo_relate is used the default is anyinteraction!
`See Oracle Documentation for details <https://docs.oracle.com/en/database/oracle/oracle-database/23/spatl/spatial-operators-reference.html>`_.

Mandatory properties
""""""""""""""""""""
.. code-block:: yaml

providers:
- type: feature
name: OracleDB
data:
host: 127.0.0.1
port: 1521
service_name: XEPDB1
user: geo_test
password: geo_test
id_field: id
table: lakes
geom_field: geometry
title_field: name
manadory_properties:
- example_group_id

On large tables it could be useful to disallow a query on the complete dataset. For this reason it is possible to
configure mandatory properties. When this is activated, the provoder throws an exception when the parameter
is not in the query uri.

Custom SQL Manipulator Plugin
"""""""""""""""""""""""""""""
The provider supports a SQL-Manipulator-Plugin class. With this, the SQL statement could be manipulated. This is
useful e.g. for authorization at row level or manipulation of the explain plan with hints.

Expand Down
Loading
Loading