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

Add support for Buffer values #87

Merged
merged 2 commits into from
Sep 4, 2023

Conversation

vecerek
Copy link
Contributor

@vecerek vecerek commented Sep 4, 2023

Fixes #86

The solution is a bit more complex because I don't have access to the Buffer type. If I try to access the type, I get the following error:

Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.ts(2580)

This PR implements a Buffer check that does not rely on @types/node to be installed, even though, I would much prefer that solution. The mysql package is built on top of mariadb which is a nodejs-specific implementation. However, I wasn't sure about the platform-specificity of this repo.

@tim-smart any objections against pulling in @types/node? If the packages should be platform-agnostic, I think there's some extra work to do to achieve that for the mysql package, at least.

@tim-smart
Copy link
Owner

I would like to avoid @types/node if possible, as the sqlite package targets browsers.

Will take a look at this in a couple hours :)

@tim-smart tim-smart marked this pull request as ready for review September 4, 2023 21:00
@tim-smart tim-smart merged commit 5c154a1 into tim-smart:main Sep 4, 2023
@github-actions github-actions bot mentioned this pull request Sep 4, 2023
@vecerek vecerek deleted the add-support-for-buffers branch September 5, 2023 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing buffer values to sql produces invalid queries
2 participants