brianc / node-libpq

Simple, low level native bindings to PostgreSQL's libpq from node.js
112 stars 42 forks source link

it seems zeros and nulls cannot be passed to parameterized queries #23

Closed trailsandtribulations closed 9 years ago

trailsandtribulations commented 9 years ago

in the parameterized query insert into place_type( plt_id, name, category, spr_plt_id, descr ) values( $1, $2, $3, $4, $5 ) returning *

with the array

[ 5, 0, 'wat', 'what', null ]

I get the error

when I substitute 1 and 'something' for 0 and null, it works.

this seems to be pretty major. am I missing something obvious? (hope so!)

trailsandtribulations commented 9 years ago

never mind

was using args.filter when I needed args.map