© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
1 reply
roman910

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', '')})`
    },
})
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]}
{"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
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Drizzle Queries in Drizzle Studio
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle studio in vps
Drizzle TeamDTDrizzle Team / help
5mo ago
Error in Drizzle.studio
Drizzle TeamDTDrizzle Team / help
11mo ago
Use drizzle studio without local.drizzle.studio?
Drizzle TeamDTDrizzle Team / help
2y ago