wiring up database