open method

Future<bool> open({
  1. Function? populateFunction,
  2. int timeoutInSeconds = 30,
  3. int queryTimeoutInSeconds = 30,
  4. String timeZone = 'UTC',
  5. bool useSSL = false,
  6. bool isUnixSocket = false,
  7. bool allowClearTextPassword = false,
})

Implementation

Future<bool> open({
  Function? populateFunction,
  int timeoutInSeconds = 30,
  int queryTimeoutInSeconds = 30,
  String timeZone = 'UTC',
  bool useSSL = false,
  bool isUnixSocket = false,
  bool allowClearTextPassword = false,
}) async {
  bool opened = await _postgresDb.open(
    populateFunction: populateFunction,
    timeoutInSeconds: timeoutInSeconds,
    queryTimeoutInSeconds: queryTimeoutInSeconds,
    timeZone: timeZone,
    useSSL: useSSL,
    isUnixSocket: isUnixSocket,
    allowClearTextPassword: allowClearTextPassword,
  );
  if (!opened) {
    return false;
  }

  var res = await _postgresDb.select("SELECT PostGIS_full_version();");
  if (res == null) {
    return false;
  }
  pgVersion = res.first.getAt(0);

  return opened;
}