3dcitydb / citydb-tool

3D City Database 5.0 CLI to import/export city model data and to run database operations
Apache License 2.0
9 stars 2 forks source link

Add SQL query builders and improved CLI query options #28

Closed clausnagel closed 2 months ago

clausnagel commented 2 months ago

This PR complements the Filter API introduced in #23 with SQL builders that map filter expressions onto SQL query statements. The filter capabilities have also been added to the CLI. Users can now easily type filter expressions on the command-line or provide them via a config file when exporting or deleting features. The filter expressions are translated to SQL by the new builders in the background to retrieve only those features matching the provided filter. The extended CQL2 filtering language as introduced in #23 must be used for writing filters.

The SQL builders dynamically map filter expressions onto SQL statements by using the JSON-based schema mapping information stored in the tables datatype and objectclass. This way, future changes or extensions to the 3DCityDB v5 schema will be automatically supported by the filtering language without having to write additional code.