binary columns in drizzle studio

I have implemented the following custom type for storing blockchain addresses:
const address = customType<{ data: string; driverData: Buffer }>({
    dataType: () => 'BINARY(20)',
    fromDriver(value) {
        return '0x' + value.toString('hex')
    },
    toDriver(value: string) {
        return sql`UNHEX(${value.replace('0x', '')})`
    },
})

It works fine but it looks like this in the studio (see the image):

{"type":"Buffer","data":[5,28,95,169,85,206,197,80,50,253,93,23,182,67,212,62,249,70,208,56]}


It is pretty annoying because it is impossible to see or copy any address from the studio, nor use them as filters.

I do not know if there is any better solution at the moment for my problem. I tried to use the built-in binary type but I haven't managed to insert any address with it.
image.png
Was this page helpful?