Skip to content
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

[BUG]: Blob column doesn't work with turso #1926

Closed
theodem opened this issue Feb 26, 2024 · 3 comments
Closed

[BUG]: Blob column doesn't work with turso #1926

theodem opened this issue Feb 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@theodem
Copy link

theodem commented Feb 26, 2024

What version of drizzle-orm are you using?

0.29.1

What version of drizzle-kit are you using?

No response

Describe the Bug

sqliteTable('table', { id: integer('id', { mode: 'number' }).primaryKey({ autoIncrement: true }), binary: blob('binary').notNull().type<ArrayBuffer>(), });

When i query the binary column, the typeof binary is a string which is the UTF8 encoded version of initial ArrayBuffer.

Using turso driver with libsql dev environment

Expected behavior

No response

Environment & setup

No response

@theodem theodem added the bug Something isn't working label Feb 26, 2024
@theodem
Copy link
Author

theodem commented Feb 27, 2024

This problem come from the environment where drizzle is running, in my case cloudflare workers which does not support Buffer.

Just tried in a classic node environment and it works ok.

Maybe we should implement a workaround to use ArrayBuffer in environnement that does not support Buffer ?

@theodem
Copy link
Author

theodem commented Feb 27, 2024

Closing it as it is working when using a polyfill to globalThis.Buffer

@dn-l
Copy link

dn-l commented Apr 4, 2024

@theodem I'd reopen the issue because it should be working without polyfill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants