test db code