pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Add a ProcessManager backed by PostgreSql

Open francescoingv opened this issue 1 year ago • 1 comments

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?

francescoingv avatar Jun 11 '24 10:06 francescoingv

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

vprivat-ads avatar Jul 04 '24 14:07 vprivat-ads