MagicStack / MagicStack/asyncpg
Inserting multiple values in a row
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
* **asyncpg version**: 0.29.0
* **PostgreSQL version**: 15.4
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**: No
* **Python version**: 3,8,9
* **Platform**: Windows 7
* **Do you use pgbouncer?**: No
* **Did you install asyncpg with pip?**: Yes
* **If you built asyncpg locally, which version of Cython did you use?**: None
* **Can the issue be reproduced under both asyncio and
[uvloop](https://github.com/magicstack/uvloop)?**: No
Hello.
I'm migrating from psycopg2 to asyncpg and I still don't understand much and have questions.
Sorry if they are stupid :)
To fill all the cells in a row in **psycopg2** I specified:
```
"""INSERT INTO table_name VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);""",
(
"here is a list of data"
)
```
For the same operation in **asyncpg** I need to specify the names of all columns, i.e. the code is twice as large.
Is this the only correct solution?
```
"""INSERT INTO table_name
(
"here is a list of column names"
)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15);""",
(
"here is a list of data"
)
```
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
Il report menziona asyncpg, PostgreSQL 15.4, Python e un'istruzione INSERT, ma non identifica alcun file del repository né alcun test. Inizia esaminando la gestione documentata degli argomenti di INSERT in asyncpg insieme alla sintassi di PostgreSQL; il lavoro sarà considerato concluso solo con una risposta confermata da un maintainer o con una modifica definita in modo circoscritto accompagnata da un test di regressione.
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à
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100