generate source files using db method