dmfay / massive-js

A data mapper for Node.js and PostgreSQL.
2.49k stars 158 forks source link

Dynamic table name in a .sql file? #574

Closed jnystrom closed 6 years ago

jnystrom commented 6 years ago

I dont think this is possible, but wanted to make sure. Can I pass in a dynamic table name as a var ($1) and use that in a .sql file (select * from $1 where test = $2) ?

dmfay commented 6 years ago

You can!

jnystrom commented 6 years ago

Can I use that syntax in a massive .sql file? Will play with it, thanks.