Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Add ByteArray Field #149

@arqvt

Description

@arqvt

Checklist

  • There are no similar issues or pull requests for this yet.
  • I discussed this idea on the community chat and feedback is positive.

Is your feature related to a problem? Please describe.

I want to be able to make a ByteArray field for my projects.

Describe the solution you would like.

For example, i would like to have the BYTEA Type in ORM.
Eg:

import orm
...
class Example(orm.Model):
    tablename = "example"
    registry = metadata

    fields = {
        "user_id": orm.BigInteger(primary_key=True),
        "example_bytes": orm.ByteArray()
    }

And when i do for example,

field_ex = Example
# in async func
data = await field_ex.objects.get(user_id=1)
return data.example_bytes # this would return python bytes

Describe alternatives you considered

I considered using raw asyncpg which i am, but i would like the bytearray field in ORM so i can use it.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions