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

MySQL query #121

Open
pasynkov opened this issue Sep 12, 2015 · 2 comments
Open

MySQL query #121

pasynkov opened this issue Sep 12, 2015 · 2 comments

Comments

@pasynkov
Copy link

Can this module build a MySQL query?

example:
{ type: 'select',
table: 'some_table',
where: { id: { '$gt': 1 } }
}

pg: {
text: 'select "some_table".* from "some_table" where "some_table"."id" > $1',
values: [ 1 ]
}

but can i receive MySQL query?

mysql: {
text: 'select some_table.* from some_table where some_table.id > ?',
values: [ 1 ]
}

if not .. can i replace $n values in query? thanks for help

@jrf0110
Copy link
Member

jrf0110 commented Sep 12, 2015

It currently cannot. Adding the functionality would actually be fairly easy, though.

Please see #119

I also want to say there's a way to put MySQL into a mode where it accepts the $1, $2, ... style prepared statement parameters, but I can't find it. Maybe I'm imagining that.

Hope this helps.

I'll keep this open and think about implementing a MySQL syntax this weekend.

@pasynkov
Copy link
Author

thans, this help!

This is great SQL-builder! MySQL support will be amazing!

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