Allow retrieving extra properties in oracle provider (#1544)

* Implement extra_properties in oracle Provider

These can be used to configure additional database-computed fields
in the config file which are returned on `get` and `query` calls

* Allow mandating properties which are not part of the output

Previously, properties which were not requested for the output
were not part of `fields`, which means that they were not passed
in to the provider as filter properties for e.g. `query()`.

This commit adds them there and introduces a new variable
`filtered_fields`, which is used for limiting the output of queries.

There is also some minor refactoring, but the existing and also the
newly written tests should avoid regressions.

* Restore previous behavior for default arguments
This commit is contained in:
Bernhard Mallinger
2024-03-06 16:24:51 +01:00
committed by GitHub
parent 34d595accf
commit 8d377072b9
3 changed files with 122 additions and 31 deletions
@@ -357,13 +357,37 @@ Mandatory properties
table: lakes
geom_field: geometry
title_field: name
manadory_properties:
mandatory_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.
Extra 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
extra_properties:
- "'Here we have ' || name AS tooltip"
Extra properties is a list of strings which are added as fields for data retrieval in the SELECT clauses. They
can be used to return expressions computed by the database.
Custom SQL Manipulator Plugin
"""""""""""""""""""""""""""""
The provider supports a SQL-Manipulator-Plugin class. With this, the SQL statement could be manipulated. This is