debug main db access