Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make connection command-line parameters optional #156

Closed
captaincoordinates opened this issue Jan 31, 2023 · 0 comments · Fixed by #160
Closed

Make connection command-line parameters optional #156

captaincoordinates opened this issue Jan 31, 2023 · 0 comments · Fixed by #160

Comments

@captaincoordinates
Copy link

captaincoordinates commented Jan 31, 2023

It is not currently possible to connect to RDS Proxy using pypgstac due to its use of command-line parameters. Connection attempts fail with

connection to server at "...rds.amazonaws.com" (IP), port 5432 failed: FATAL: Feature not supported: RDS Proxy currently doesn’t support command-line options.

I've also seen a similar error when working with pgbouncer.

I had to override the PgstacDB class with the following to make this work

class _ProxyCompatiblePgstacDB(PgstacDB):
    def get_pool(self) -> ConnectionPool:
        if self.pool is None:  # type: ignore
            self.pool = ConnectionPool(
                conninfo=self.dsn,
                min_size=pypgstac_settings.db_min_conn_size,
                max_size=pypgstac_settings.db_max_conn_size,
                max_waiting=pypgstac_settings.db_max_queries,
                max_idle=pypgstac_settings.db_max_idle,
                num_workers=pypgstac_settings.db_num_workers,
            )
        return self.pool

    def connect(self) -> Connection:
        connection = super().connect()
        connection.execute("set search_path = pgstac,public")
        return connection

Perhaps there can be a configuration option, or a variation on the above, to avoid always attempting to send command-line options.

@drnextgis drnextgis mentioned this issue Feb 13, 2023
bitner added a commit that referenced this issue Feb 20, 2023
bitner added a commit that referenced this issue Feb 21, 2023
* Change directory structure to put pypgstac and pgstac under /src

* switch pypgstac to use hatch

* move migrations to the pgstac tree

* make symlink in pypgstac for migrations

* move pgstac.sql to src/pgstac/

* update scripts and docker setup

* Cleanup unused files. Adjust tests to work with new scripts

* update sql with partitioning rework and maintenance tooling

* fix: allow missing aws credential in pre-commit

* switch from methodtools to cachetools, remove commented out code

* add fix for #156

---------

Co-authored-by: Matt McFarland <mmcfarland@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant