import to db function