db get function