bsw@1145: -- open and set default database handle bsw@1145: _G.db = assert(mondelefant.connect(config.database)) bsw@1145: bsw@1145: function mondelefant.class_prototype:get_db_conn() return db end bsw@1145: bsw@1145: -- enable output of SQL commands in trace system bsw@1145: function db:sql_tracer(command) bsw@1145: return function(error_info) bsw@1145: local error_info = error_info or {} bsw@1145: trace.sql{ command = command, error_position = error_info.position } bsw@1145: end bsw@1145: end bsw@1145: bsw@1145: execute.inner() bsw@1145: bsw@1145: -- close the database bsw@1145: db:close()