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

Input streaming support #19

Open
jorgebay opened this issue Aug 28, 2013 · 0 comments
Open

Input streaming support #19

jorgebay opened this issue Aug 28, 2013 · 0 comments

Comments

@jorgebay
Copy link
Owner

(Split from #18)
Using the prepared statements, as queries are binary, it would be possible to use streams as input parameters for blobs.

Use cases

  • Store streams coming from network or large files.

Sample

var fs = require('fs');
//a file stream, it could be any readable stream
var fileStream = fs.createReadStream(filePath);
var query = 'INSERT INTO table1 (id, big_blob) VALUES (?, ?)';
//pass the stream as an argument
client.executeAsPrepared(query, [1, fileStream], function (err) {
  //...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant