Inserting multiple values in a row
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The report mentions asyncpg, PostgreSQL 15.4, Python, and an INSERT statement, but identifies no repository file or test. Start by reviewing asyncpg's documented INSERT argument handling alongside PostgreSQL syntax; done requires a maintainer-confirmed answer or a narrowly specified change with a regression test.
Written by the indexing model from the issue text.
Description
- 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?: 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"
)
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 469
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicStack/asyncpg
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MagicStack/asyncpg#1357 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
MagicStack/asyncpg#1354 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
MagicStack/asyncpg#1342 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
MagicStack/asyncpg#1340 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 28/100
MagicStack/asyncpg#1337 ·
All issues in MagicStack/asyncpg
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·