Skip to content

Cannot pass ArrayBuffer to executeAsync #212

@SlugFiller

Description

@SlugFiller

Minimal example:

const db = open({ name: 'mydb.sqlite' });
(async () => {
	try {
		console.log(await db.executeAsync('SELECT ?', [new ArrayBuffer(10)]));
	}
	catch(e) {
		console.log(e);
	}
})().catch(() => {});

Output:

Error: `data()` can only be accessed synchronously on the JS Thread! If you want to access it elsewhere, copy it first.

It seems ArrayBuffer needs to have its data extracted and copied (or transferred) before sending it to Promise::async.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions