Created
June 21, 2014 17:22
-
-
Save myndzi/03eb5c42e8385470403c to your computer and use it in GitHub Desktop.
How to use Sequelize with a UNIX domain socket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sequelize = new Sequelize('postgres:/tmp'); | |
var CM = sequelize.transactionManager.ConnectorManager; | |
sequelize.transactionManager.ConnectorManager = function (sequelize, config) { | |
var cm = new CM(sequelize, config); | |
cm.pg.defaults.database = 'database_name'; | |
return cm; | |
} | |
sequelize.getQueryInterface().QueryGenerator | |
.databaseConnectionUri = function () { return '/tmp'; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a lot simpler if you set the
host
in theoptions
object and usenull
for bothusername
andpassword
:See: sequelize/sequelize#1591