不要怂,就是干,撸起袖子干!

Commit 47efc3ab by Daniel Schwartz

adding protocol

1 parent be00bda0
...@@ -44,15 +44,18 @@ module.exports = (function() { ...@@ -44,15 +44,18 @@ module.exports = (function() {
this.isConnecting = true this.isConnecting = true
this.isConnected = false this.isConnected = false
var conStr = 'tcp://<%= user %>:<%= password %>@<%= host %>:<%= port %>/<%= database %>' var conStr = '<%= protocol %>://<%= user %>:<%= password %>@<%= host %>:<%= port %>/<%= database %>'
conStr = Utils._.template(conStr)({ conStr = Utils._.template(conStr)({
user: this.config.username, user: this.config.username,
password: this.config.password, password: this.config.password,
database: this.config.database, database: this.config.database,
host: this.config.host, host: this.config.host,
port: this.config.port port: this.config.port,
protocol: this.config.protocol
}) })
console.log(conStr);
var pg = require("pg") var pg = require("pg")
this.client = new pg.Client(conStr) this.client = new pg.Client(conStr)
......
...@@ -15,6 +15,7 @@ module.exports = (function() { ...@@ -15,6 +15,7 @@ module.exports = (function() {
dialect: 'mysql', dialect: 'mysql',
host: 'localhost', host: 'localhost',
port: 3306, port: 3306,
protocol: 'tcp',
define: {}, define: {},
query: {}, query: {},
sync: {}, sync: {},
...@@ -37,7 +38,8 @@ module.exports = (function() { ...@@ -37,7 +38,8 @@ module.exports = (function() {
password: (( (["", null, false].indexOf(password) > -1) || (typeof password == 'undefined')) ? null : password), password: (( (["", null, false].indexOf(password) > -1) || (typeof password == 'undefined')) ? null : password),
host : this.options.host, host : this.options.host,
port : this.options.port, port : this.options.port,
pool : this.options.pool pool : this.options.pool,
protocol: this.options.protocol
} }
var ConnectorManager = require("./dialects/" + this.options.dialect + "/connector-manager") var ConnectorManager = require("./dialects/" + this.options.dialect + "/connector-manager")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!