rewrited db() in default.cc