Connection.Options (gb.db)

Property Options As Collection

Desde 3.18

Return or set the connection options.

These options are specific to the database type.

This property must be set before opening the connection.

Modifying an option after the connection has been opened has no effect.

At the moment, all MySQL and PostgreSQL connection options should be supported. Other database drivers have no options at the moment.

Unknown options are silently ignored.

MySQL options

The list of MySQL options is described here:

The name of the option is its MySQL name, with the MYSQL_ or MYSQL_OPT_ prefix removed.

The name is case insensitive.

The value of the PROTOCOL, SSL_MODE and SSL_FIPS_MODE options, that take their value among integer constants, is defined by a string corresponding to the value part of the constant symbol.


MyConnection.Options["PROTOCOL"] = "TCP"
MyConnection.Options["READ_TIMEOUT"] = 30
MyConnection.Options["SSL_MODE"] = "REQUIRED"
MyConnection.Options["SSL_FIPS_MODE"] = "OFF"

PostgreSQL options

The list of PostgreSQL options is described here:

The name of the option is its PostgreSQL name unmodified.

The name is case insensitive.

All options values are converted to string before being sent to the PostgreSQL API.


MyConnection.Options["connect_timeout"] = 15
MyConnection.Options["keepalive"] = 0
MyConnection.Options["sslmode"] = "required"