isConnectionAlive method

Future<bool> isConnectionAlive()

isConnectionAlive

Implementation

Future<bool> isConnectionAlive() async {
  try {
    await query('select 1').timeout(Duration(milliseconds: 500),
        onTimeout: () {
      throw TimeoutException('test isConnectionAlive timeout.');
    });
    return true;
  } catch (e) {
    return false;
  }
}