database access on demand