Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Can you combine QueryStream & Prepared Statements? #18

Open
if-kenn opened this issue Mar 19, 2016 · 4 comments
Open

Can you combine QueryStream & Prepared Statements? #18

if-kenn opened this issue Mar 19, 2016 · 4 comments
Assignees

Comments

@if-kenn
Copy link

if-kenn commented Mar 19, 2016

Is this possible?

When I do something like:

var pg          = require('pg'),
    QueryStream = require('pg-query-stream');
    credUrl     = {...};

pg.connect(credUrl, function(err, client, done) {
    var query       = new QueryStream({text : 'SELECT 10 as ten;', name : 'select10'}, []),
        stream      = client.query(query);
});

I get "TypeError: Argument must be a string". Am I missing something?

@btd
Copy link

btd commented Mar 22, 2016

I would suggest you to try:

var query = new QueryStream('SELECT 10 as ten', []);
qyery.name = 'select10';

I have not tried it yet myself. But by idea it should work.

@goloroden
Copy link

Any (official) update on this?

Now with [email protected] this becomes really important

@brianc brianc self-assigned this Aug 6, 2017
@brianc
Copy link
Owner

brianc commented Aug 6, 2017

This isn't currently supported but I can add it as a new feature.

If you or your company benefit from node-postgres and have the means, please consider supporting my work on Patreon.

@goloroden
Copy link

This would be really great 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants