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

Colons in date format string enclosed in single quotes treated as parameters. #13

Closed
ericxinzhang opened this issue Dec 18, 2019 · 3 comments
Assignees

Comments

@ericxinzhang
Copy link

ericxinzhang commented Dec 18, 2019

Code snippet:

const named = require('yesql').pg;
...
const sql = `select name, value, to_char(created_at,  'YYYY-MM-DD HH24:MI:SS') from table1 where created_at > :from and created_at <= :to;`;
return named(sql)({from: new Date(0), to: new Date()});

Got following error:

Error: Missing value for statement.
MI not provided for statement:
...
@pihvi
Copy link
Owner

pihvi commented Dec 18, 2019

Thanks for the report! I'll start working on this asap.

@pihvi pihvi self-assigned this Dec 18, 2019
@pihvi
Copy link
Owner

pihvi commented Dec 19, 2019

This is now supported in just released version 4.0.0.

Please report if it's not working as expected.

@pihvi pihvi closed this as completed Dec 19, 2019
@ericxinzhang
Copy link
Author

This is now supported in just released version 4.0.0.

Please report if it's not working as expected.

That's awesome! Thanks for quick response!

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

No branches or pull requests

2 participants