mongo-sql icon indicating copy to clipboard operation
mongo-sql copied to clipboard

MySQL query

Open pasynkov opened this issue 10 years ago • 2 comments

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

pasynkov avatar Sep 12 '15 16:09 pasynkov

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

Please see https://github.com/goodybag/mongo-sql/issues/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.

jrf0110 avatar Sep 12 '15 21:09 jrf0110

thans, this help!

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

pasynkov avatar Sep 13 '15 07:09 pasynkov