Skip to content

Commit

Permalink
FIX: DB usage (mysql, posgresql). #143
Browse files Browse the repository at this point in the history
  • Loading branch information
Massimiliano Bertinetti committed Mar 17, 2018
1 parent 4fff854 commit f64044b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rockspecs/sailor-current-1.rockspec
Expand Up @@ -6,7 +6,7 @@ source = {
description = {
summary = "A Lua MVC Framework",
detailed = [[
Sailor is a web framework written in Lua that follows the MVC design pattern.
Sailor! is a web framework written in Lua that follows the MVC design pattern.
]],
homepage = "http://sailorproject.org",
license = "MIT"
Expand Down
9 changes: 5 additions & 4 deletions src/sailor/blank-app/conf/conf.lua
Expand Up @@ -18,11 +18,12 @@ local conf = {

db = {
development = { -- current environment
driver = 'mysql',
driver = '', -- mysql, postgres or sqlite3
host = '',
user = '',
pass = '',
dbname = ''
port = '', -- optional
user = '', -- no need with sqlite3
pass = '', -- no need with sqlite3
dbname = '' -- filename.db for sqlite3
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/sailor/db/luasql_common.lua
Expand Up @@ -40,7 +40,7 @@ end
function db.connect()
if db.transaction then return end
db.env = assert (luasql[conf.driver]())
db.con = assert (db.env:connect(conf.dbname,conf.user,conf.pass,conf.host))
db.con = assert (db.env:connect(conf.dbname,conf.user,conf.pass,conf.host, conf.port))
end

-- Closes the connection of the instance
Expand Down

0 comments on commit f64044b

Please sign in to comment.