[Tile-serving] [openstreetmap/osm2pgsql] Can Flex styles run arbitrary SQL against the database? (#1415)

Jochen Topf notifications at github.com
Thu Feb 11 15:47:07 UTC 2021


No, you can't access the database connection information from Lua. But osm2pgsql uses the `libpq` library internally that `psql` and basically all other database tools use to access a PostgreSQL database. And that library understands [certain environment variables](https://www.postgresql.org/docs/current/libpq-envars.html) that specify the database you want to connect to. So if you run your processing from a script that sets these first, all tools should just magically connect to the same database.

And no, there is no way to trigger some Lua code to be run after processing. But it would be easy to have a setup where you have a Lua script run after osm2pgsql and from that Lua script `include` a Lua "settings" file that is also `include`d by the Lua osm2pgsql config file. This way you can share any settings you want. You can also read environment variables from Lua using normal Lua methods. This gives you another way of parameterizing Lua config files if needed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/1415#discussioncomment-359964
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20210211/7f922bb6/attachment.htm>


More information about the Tile-serving mailing list