instance property

DBWrapper get instance

Returns the active connection (MySQL or PostgreSQL).

Implementation

static DBWrapper get instance {
  _ensureConnected();
  if (_driver == null) {
    throw Exception("Database not initialized.");
  }
  return _driver == DBDriver.mysql ? _mysql! : _pg!;
}