Skip to content

v.0.3.0

Compare
Choose a tag to compare
@vitaly-t vitaly-t released this 07 Mar 02:39
· 2613 commits to master since this release

All queries now accept a flexible parameter formatting.

Examples:

db.many('select * from users where name like $1', 'tom');
db.one('select * from audit where entity=$1 and when>$2::timestamp', ['users', new Date()]);

There can be either one parameter or an array of parameters.
The version was upped to 0.3, because the function declaration had to change to:

// db.func(query, qrm, values)
db.func('select * from users where created > $1::timestamp', queryReqult.many, [new Date()]);

This change makes it consistent with parameters for db.query

There will be changes to the documentation to provide better examples.