In my db
library file, I have:
exports.slave = ->
connection = mysql.createConnection
host: config.database.slave.host
user: config.database.slave.username
password: config.database.slave.password
database: config.database.slave.database
connection.connect()
return connection
which returns connection
if I run db.slave().query("WHATEVER")
and executes properly. How can I extend and export a prototype, so I can just use: db.slave.query("WAHTEVER")
instead?