connect method

int connect(
  1. String connectionString
)
inherited

Establishes a new database connection.

The connectionString should be a valid ODBC connection string (e.g., 'DSN=MyDatabase' or 'Driver={SQL Server};Server=...').

Returns a connection ID on success, 0 on failure. Throws StateError if the environment has not been initialized.

Implementation

int connect(String connectionString) => _captureSync(
      'connect',
      () {
        if (!_isInitialized) {
          throw StateError('Environment not initialized');
        }
        return _native.connect(connectionString);
      },
      failed: (value) => value == 0,
    );