-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(store-sync): byte array type in decoded indexer #2251
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5607081 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
toDriver(data: boolean[]): string[] { | ||
return data.map((datum) => String(datum)); | ||
}, | ||
fromDriver(driverData: string[]): boolean[] { | ||
return driverData.map((datum) => Boolean(datum)); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@holic do you have any intuition why these drivers don't work?
As Uint8Array
is interpreted as bytea
, I would expect Uint8Array[]
to be interpreted as bytea[]
. Yet this errors with PostgresError: column "value" is of type bytea[] but expression is of type bytea
. Test run:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure! I do recall seeing some weird behavior with drizzle driver and the way it translates between types, but can't recall when/where/why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi to future readers: I meant to highlight the bytes drivers, not boolean.
address
,byteX
arrays now use array column types instead of JSON blobs in the decoded indexer.Seems like the drivers are incorrectly set up as the indexer errors when trying to store a byte array:
PostgresError: column "hooks" is of type bytea[] but expression is of type bytea