geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
459 stars 250 forks source link

Add a ProcessManager backed by PostgreSql #1677

Open francescoingv opened 3 weeks ago

francescoingv commented 3 weeks ago

Is your feature request related to a problem? Please describe. I would like to store the job data in a PostgreSql DB

Describe the solution you'd like I developed a PostgreSqlDBManager based on TinyDBManager. I would like to submit the file for additional checking: could it be included in pygeoapi distribution, or in some alternative repository?

I would need also advice on how/where to release the script to create the required table(s).

I assumed the configuration parameters come from the configuration file, however they would include user/password to access the DB: is there a better approach?

vprivat-ads commented 6 hours ago

I assumed the configuration parameters come from the configuration file, however they would include user/password to access the DB: is there a better approach?

I guess that wouldn't be a problem given the current way to configure the postgresql provider:

        providers:
          - type: feature
            name: PostgreSQL
            data:
                host: localhost
                dbname: test
                user: postgres
                password: postgres
                search_path: [osm, public]
            options:
                # Maximum time to wait while connecting, in seconds.
                connect_timeout: 10
                # Number of *milliseconds* that transmitted data may remain
                # unacknowledged before a connection is forcibly closed.
                tcp_user_timeout: 10000
                # Whether client-side TCP keepalives are used. 1 = use keepalives,
                # 0 = don't use keepalives.
                keepalives: 1
                # Number of seconds of inactivity after which TCP should send a
                # keepalive message to the server.
                keepalives_idle: 5
                # Number of TCP keepalives that can be lost before the client's
                # connection to the server is considered dead.
                keepalives_count: 5
                # Number of seconds after which a TCP keepalive message that is not
                # acknowledged by the server should be retransmitted.
                keepalives_interval: 1
            id_field: osm_id
            table: hotosm_bdi_waterways
            geom_field: foo_geom