Search code examples
javascriptsqlnode.jsdialect

How to set the SQL dialect in node-sql?


I am trying to include the node-sql module in a node.js project. It generates SQL statements from Javascript for mysql, postgresql and sqllite.

I have searched the documentation, but I does not explain how to set the dialect to generate SQL statements. Does anyone know how to achieve this?


Solution

  • sql.setDialect('pg'); // Sets dialect for Postgres.
    

    https://github.com/brianc/node-sql/blob/master/test/index-tests.js