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

Dialect selection rather than both mysql & postgres #3

Closed
fritzy opened this issue Sep 29, 2015 · 2 comments
Closed

Dialect selection rather than both mysql & postgres #3

fritzy opened this issue Sep 29, 2015 · 2 comments
Labels

Comments

@fritzy
Copy link

fritzy commented Sep 29, 2015

Knex does it like this:

let knex = require('knex')({dialect: 'pg'})

I could see having a .PG and .MySQL object, and sharing code where possible, or having a constructor like knex with a dialect option.

@felixfbecker
Copy link
Owner

Hmmmm. You must admit "it just works" is kind of cool aswell. The point is to avoid all the configuration knex requires. What do you think about SQL.setDialect('mysql')? Example:

let SQL = require('sql-template-strings') // will work in hybrid mode
let SQL = require('sql-template-strings').setDialect('mysql') // sets dialect to mysql and returns this

@fritzy
Copy link
Author

fritzy commented Sep 29, 2015

makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants