MagicStack / MagicStack/asyncpg
feat: allow connection with pre-configured socket
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 8.1k
- Forks
- 468
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I'd like to add support for creating a postgres connection over an existing socket like object. In this approach startTLS can or cannot be used depending on the caller. This lines up similarly with what we have in Java ([socketFactory connection param](https://jdbc.postgresql.org/documentation/use/#connection-parameters), [driver code](https://github.com/pgjdbc/pgjdbc/blob/aff581fe806f1c1cdc8bcd9e5a981e37691b44b5/pgjdbc/src/main/java/org/postgresql/core/SocketFactoryFactory.java#L25-L47)), Go ([pgx DialFunc](https://pkg.go.dev/github.com/jackc/pgconn#DialFunc)) (these two are slightly different as they allow specifying a creator/generator func that creates the socket, while here we could just pass in the socket directly but the extent of the feat is the same), and other Python libraries ([pymysql](https://github.com/PyMySQL/PyMySQL/blob/main/pymysql/connections.py#L626), and [pg8000](https://github.com/tlocke/pg8000/pull/136))
The equivalent pymysql PR that introduced this change explains the feature really well https://github.com/PyMySQL/PyMySQL/pull/355
The benefit of this feature is that it allows the user to specify their own secure tunnel to connect over (such as ssh).
Is this sort of feat possible for asyncpg?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par suivre la configuration de la connexion d’asyncpg et comparez les références à socketFactory, DialFunc et PyMySQL liées dans l’issue. Déterminez comment un socket existant et un startTLS facultatif s’intégreraient à l’API, puis vérifiez que c’est terminé avec une couverture pour les deux choix TLS et les connexions via tunnel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- postgresql, python
- Domaine
- databases
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100