We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
D1, Wrangler
Wrangler
2.6.2 and 2.7.1
Linux
In summary there is an inconsistency between wrangler miniflare sqlite and D1.
D1 produces an error whenever an insert with a blob on non array format params to be an array of string | number | boolean | null | array
params
string | number | boolean | null | array
sqlite produces an error whenever an insert with a blob on non Uint8Array SQLite3 can only bind numbers, strings, bigints, buffers, and null
SQLite3 can only bind numbers, strings, bigints, buffers, and null
Sample DB: CREATE TABLE test_blob ( value BLOB NOT NULL); This code works in D1 but not in local:
CREATE TABLE test_blob ( value BLOB NOT NULL);
const value = crypto.getRandomValues(new Uint8Array(12)) await d1 .prepare('INSERT INTO test_blob(value) VALUES(?1)' ) .bind(Array.from(value)) .run();
This code runs in local but not in D1:
const value = crypto.getRandomValues(new Uint8Array(12)) await d1 .prepare('INSERT INTO test_blob(value) VALUES(?1)' ) .bind(value) .run();
Miniflare relatedCode https://github.com/cloudflare/miniflare/blob/master/packages/d1/src/statement.ts
Based on this: https://github.com/cloudflare/wrangler2/blob/main/packages/wrangler/templates/d1-beta-facade.js
Shouldn't D1 accept ArrayBuffers and Uint8Array?
I apologize if I'm mistaken with my assumptions or if this is the issue has to be opened somewhere else.
The text was updated successfully, but these errors were encountered:
D1Database
cloudflare/miniflare@2d0fbc6
miniflare
2.12.0
Successfully merging a pull request may close this issue.
Which Cloudflare product(s) does this pertain to?
D1, Wrangler
What version of
Wrangler
are you using?2.6.2 and 2.7.1
What operating system are you using?
Linux
Describe the Bug
In summary there is an inconsistency between wrangler miniflare sqlite and D1.
D1 produces an error whenever an insert with a blob on non array format
params
to be an array ofstring | number | boolean | null | array
sqlite produces an error whenever an insert with a blob on non Uint8Array
SQLite3 can only bind numbers, strings, bigints, buffers, and null
Sample DB:
CREATE TABLE test_blob ( value BLOB NOT NULL);
This code works in D1 but not in local:
This code runs in local but not in D1:
Miniflare relatedCode
https://github.com/cloudflare/miniflare/blob/master/packages/d1/src/statement.ts
Based on this:
https://github.com/cloudflare/wrangler2/blob/main/packages/wrangler/templates/d1-beta-facade.js
Shouldn't D1 accept ArrayBuffers and Uint8Array?
I apologize if I'm mistaken with my assumptions or if this is the issue has to be opened somewhere else.
The text was updated successfully, but these errors were encountered: