MagicStack / MagicStack/asyncpg
feat: allow connection with pre-configured socket
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 8.1k
- Fork
- 468
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando la configurazione della connessione di asyncpg e confronta i riferimenti a socketFactory, DialFunc e PyMySQL collegati nell’issue. Determina come si integrerebbero nell’API un socket esistente e uno startTLS opzionale, quindi verifica il completamento con la coverage per entrambe le opzioni TLS e le connessioni tramite tunnel.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql, python
- Ambito
- databases
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100