Skip to content

how to insert bytes data into a bytea datatype column? #734

@AshwinRaam

Description

@AshwinRaam

I want to insert my image or audio file that i receive from fastapi endpoint as bytes data. I tried to insert it into using execute but it failed. psycopg2 has something like psycopg2.Binary() to convert python bytes data into the bytea format accepted by the postgresql. Can anyone give me an example to do the same with asyncpg, i really want to use asyncpg but this is error is making me to shift to psycopg2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions