add db/crate function