Description Usage Arguments Details Value Note Author(s) Examples
Manage database connection
1 2 3 | disconnect()
connect(dbname, ...)
|
dbname |
name of the database or a valid |
... |
named optional connection parameters |
disconnect
will free any query results as well
as clean up the connection data. It is called in the pakcage
.Last.lib
function when exiting R
.
If no connection parameters are supplied, the connection will fallback to default parameters. Usually this establishes a connection on the localhost to a database, if it exists, with the same name as the user.
Valid keywords and their defaults can be obtained by calling
get_conn_defaults(all = TRUE)
. A valid libpq
connection string is composed of keyword = value
pairs
separated by whitespace. You can either pass the entire string
or use named arguments. The names of the arguments will be used
as keywords and their values as values.
If a password was required but not provided, connect
will
will open a dialog and prompt for a password. The connection is
then re-tried and the status returned.
connect
returns one of:
CONNECTION_OK | Succesful connection |
CONNECTION_BAD | Connection failed |
Do not open a connection and then fork the R
process. The behavior will be unpredictable. It is perfectly
acceptable however to call connect
within each
forked instance.
Timothy H. Keitt
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.