aRTconn {aRT}R Documentation

Class aRTconn

Description

Class to store a virtual DBMS connection and manipulate databases. The connection is virtual because each time a function of this class is called, it connects, does the stuff, and then disconnects.

Objects from the Class

Objects can be created using calls of the form openConn(user, password, port, host).

Arguments

user
User of the DBMS. The default is the username logged in the system.
password
The password, default is “”.
dbms
The Database Management System, It can be “postgre” or “mysql”, according to your installation.
port
Port of the connection. The default depends on the DBMS.
host
Host to connect, default is “”, that means “localhost”.
name
The connection's name. See below.

Extends

Class aRTcomponent, directly.

Methods

createDb:
Creates a new database and returns a connection to it.
deleteDb:
Removes a database from the DBMS.
openDb:
Opens a database.
showDbs:
Lists the available databases.
addPermission:
Grants permissions on the DBMS to a given user.
getPermissions:
Lists the permissions for all users of a DBMS.
dropUser:
Removes permissions of a user in the DBMS.

Connection names

aRT supports config files storing information about the user's connections. Each user can have his/her own config file, called .aRTrc and located in the root of the home directory. An example of file is shown below:

[root]
user=root
password=abc123
dbms=mysql
[pataxo]
host=pataxo.est.ufpr.br
user=pedro

Each line starting with “[” and ending with “]” is a name for a connection, which can be used in the “name” argument of openConn(). The lines below a connection name describe the values for the parameters of the respective connection. In this file we have two connections, one called “root”, with an user, a password, and a dbms, and the other called “pataxo”, with a host and a user. The missing arguments in the description can be used as parameters to openConn().

WARNING: If this file contains passwords or any other confidential information, set its permissions correctly (reading permission only to its owner).

Author(s)

Marcos Aurelio Carrero, Pedro Ribeiro de Andrade

See Also

See aRT the package organization.


[Package aRT version 1.6-4 Index]