public function getDB($db = null)
    {
        if (null !== $db && !($db instanceof DB))
            throw new InvalidTypeException("Invalid database");
        return $db ?: $this->_source_db ?: DI::getInjector()->getInstance(DB::class);
    }