Skip to content

Passing a list as parameter #94

Closed
Closed
@juntatalor

Description

@juntatalor
  • asyncpg version: 0.9.0
  • PostgreSQL version: 9.6
  • Python version: 3.5
  • Platform: MacOS
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?: -
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : Yes

I perform SQL query with where ... in clause and can not find a way to pass a list parameter:
results = await connection.fetch('SELECT * FROM post WHERE id in ($1)', [1, 2, 3])
I always get
TypeError: an integer is required (got type list)
Is it possible to pass a list parameter to query?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions