DB usage for CLI environment; bug fix where fetch() returned an undefined