olivierphi / Node-DBI

A SQL database abstraction layer strongly inspired by the PHP Zend Framework Zend_Db API, with support of multiple Node.js database engines
https://github.com/DrBenton/Node-DBI
93 stars 22 forks source link

Add support for Postgres DSN, i.e. DATABASE_URL #33

Closed vlucas closed 9 years ago

vlucas commented 9 years ago

Adds support for passing a DSN string instead of user/pass/database, etc. with the "dsn" key. The config is still kept in JSON in order to keep other uses of the JSON config like JSON.Stringify on debug, etc. and for maximum compatibility.

olivierphi commented 9 years ago

Excellent, thanks a lot! Could you just use single quotes instead of double quotes in if (connectionParams["dsn"]), for a better code style homogeneity?

vlucas commented 9 years ago

I can change it, sure - but I matched the style of the code on line 42 above it:

   // By default run in ansiCompliant mode
   if (connectionParams["ansiCompliant"] === undefined) 
     connectionParams["ansiCompliant"] = true;
vlucas commented 9 years ago

Do you still want me to change it? I'd like to get this merged so I can deploy my app tonight if at all possible.

olivierphi commented 9 years ago

Merged ! Thanks a lot ! :-)

vlucas commented 9 years ago

Thank you! :)

vlucas commented 9 years ago

Let me know when you do another versioned release so I can use it via NPM!