pydb implementation