get db in the same file, call db once