configure_pool Configure a database pool
package require nstcl-database ?1.0?
package require nstcl ?1.0?
::nstcl::configure_pool? -immediately? ? -default? driver poolname connections? datasource? ? username? ? password? ? verbose?
This command is used to configure a database pool. connections is the number of simultaneous connections to the database than can be made. verbose should be an integer, either 0 or 1, and defaults to 0.
username and password are optional depending on which database driver you are using, and how you have your database configured. The format of the datasource parameter differs depending on the database driver you are using.
This command is not exported from the nstcl namespace.
- Causes a connection to be made to the database immediately, causing an immediate error if the connection information (datasource, username, password, etc.) is not correct. Otherwise an error will only be generated the first time that ns_db gethandle is called (or one of the database_api commands is used).
- Sets this pool as the default pool (when multiple pools are defined).
The Oracle driver uses a connection string made up of $username/$password, if datasource is the empty string, or $username/$password@$datasource if not.
The Postgres driver's datasource is a string in the form of: host:port:dbname. Depending on your Postgres configuration, some of these, or the entire data source string, may be optional.
The Solid driver's datasource is a string made up of: "tcp host port".
The Sybase driver's datasource is a string made up of the form: server:database:application. If the datasource is not provided the value of the DSQUERY enviroment variable will be used (if defined), or the literal string SYBASE if it is not. Depending on your configuration, the datasource is optional.
The SQLite driver's datasource is the path to the SQLite database file.
The MySQL driver's datasource is a string in the form of: host:port:database. Depending on your MySQL configuration, some of these, or the entire data source string, may be optional.
The ODBC driver's datasource should be a string that is a valid ODBC DSN.
load_driver, set_default_pool, database_api