nstcl  >  Documentation  >  nstcl-database  >  configure_pool

Tcl Powered!

configure_pool

NAME

configure_pool — Configure a database pool

SYNOPSIS

package require nstcl-database ?1.0?
package require nstcl ?1.0?

::nstcl::configure_pool ?-immediately? ?-default? driver poolname connections ?datasource? ?username? ?password? ?verbose?

DESCRIPTION

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.

OPTIONAL SWITCHES

-immediately
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).
-default
Sets this pool as the default pool (when multiple pools are defined).

ORACLE DATASOURCE

The Oracle driver uses a connection string made up of $username/$password, if datasource is the empty string, or $username/$password@$datasource if not.

POSTGRES DATASOURCE

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.

SOLID DATASOURCE

The Solid driver's datasource is a string made up of: "tcp host port".

SYBASE DATASOURCE

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.

SQLITE DATASOURCE

The SQLite driver's datasource is the path to the SQLite database file.

MYSQL DATASOURCE

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.

ODBC DATASOURCE

The ODBC driver's datasource should be a string that is a valid ODBC DSN.

SEE ALSO

load_driver, set_default_pool, database_api

KEYWORDS

database, nstcl