developmentseed / tipg

Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.
https://developmentseed.org/tipg/
MIT License
153 stars 23 forks source link

[BUG] TIPG_DB_EXCLUDE_TABLES only accepts list of length 1 #130

Closed jonaraphael closed 1 year ago

jonaraphael commented 1 year ago

I have a deployed TiPG instance in GCP Cloud Run, utilizing many environmental variables to control the deployment, like: "TIPG_TABLE_CONFIG__public_mytable__GEOMCOL" = mygeomcol

The DB Setting TIPG_DB_EXCLUDE_TABLES is described in the documentation as accepting a list of strings, however, it silently fails when provided with a list of length 2.

TIPG_DB_EXCLUDE_TABLES = ["public.mytable1"] <<< This works, and reduces the exposed collections to exclude mytable1 TIPG_DB_EXCLUDE_TABLES = ["public.mytable2"] <<< This works, and reduces the exposed collections to exclude mytable2 TIPG_DB_EXCLUDE_TABLES = ["public.mytable1", "public.mytable2"] <<< This fails, and the exposed collections are NOT reduced.

My version is pinned to tipg~=0.3.0

vincentsarago commented 1 year ago

Thanks for the report @jonaraphael I can confirm this and add a failing test

something is not working here https://github.com/developmentseed/tipg/blob/9c5bbf0f3c70f247ea30f343917678c163218481/tipg/sql/dbcatalog.sql#L249

vincentsarago commented 1 year ago

@jonaraphael I've started a PR https://github.com/developmentseed/tipg/pull/131 to fix this but adding more tests showed that we also have a bug for the functions.