liquid_feedback_frontend
diff app/main/_postfork/10_database.lua @ 1145:904f6807f7fa
Added support for upcoming moonbridge bases WebMCP
| author | bsw |
|---|---|
| date | Sat Mar 21 15:26:39 2015 +0100 (2015-03-21) |
| parents | |
| children | 911253ad0898 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/_postfork/10_database.lua Sat Mar 21 15:26:39 2015 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +-- open and set default database handle 1.5 +_G.db = assert(mondelefant.connect(config.database)) 1.6 + 1.7 +function mondelefant.class_prototype:get_db_conn() return db end 1.8 + 1.9 +-- enable output of SQL commands in trace system 1.10 +function db:sql_tracer(command) 1.11 + return function(error_info) 1.12 + local error_info = error_info or {} 1.13 + trace.sql{ command = command, error_position = error_info.position } 1.14 + end 1.15 +end 1.16 + 1.17 +execute.inner() 1.18 + 1.19 +-- close the database 1.20 +db:close()