db: Interface with databases

Description Usage Arguments Author(s) Examples

Description

Interface with project databases.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
getMLEs(host = getOption("aakmisc.dbhost","localhost"),
        dbname = getOption("aakmisc.dbname",NULL),
        port = getOption("aakmisc.port",5432),
        user = getOption("aakmisc.user",NULL),
        ...)
recMLEs(mle, host = getOption("aakmisc.dbhost","localhost"),
        dbname = getOption("aakmisc.dbname",NULL),
        port = getOption("aakmisc.port",5432),
        user = getOption("aakmisc.user",NULL),
        ...)
listScripts(host = getOption("aakmisc.dbhost","localhost"),
            dbname = getOption("aakmisc.dbname",NULL),
            port = getOption("aakmisc.port",5432),
            user = getOption("aakmisc.user",NULL),
            ...)
recScript(files, host = getOption("aakmisc.dbhost","localhost"),
          dbname = getOption("aakmisc.dbname",NULL),
          port = getOption("aakmisc.port",5432),
          user = getOption("aakmisc.user",NULL),
          ...)
dropScript(script, host = getOption("aakmisc.dbhost","localhost"),
           dbname = getOption("aakmisc.dbname",NULL),
           port = getOption("aakmisc.port",5432),
           user = getOption("aakmisc.user",NULL),
           ...)
catScript(script, file = "", host = getOption("aakmisc.dbhost","localhost"),
          dbname = getOption("aakmisc.dbname",NULL),
          port = getOption("aakmisc.port",5432),
          user = getOption("aakmisc.user",NULL),
          ...)
getQuery(statement,
         host = getOption("aakmisc.dbhost","localhost"),
         dbname = getOption("aakmisc.dbname",NULL),
         port = getOption("aakmisc.port",5432),
         user = getOption("aakmisc.user",NULL),
         ...)
writeDBTable(name, value, overwrite = FALSE, append = FALSE,
             row.names = FALSE,
             host = getOption("aakmisc.dbhost","localhost"),
             dbname = getOption("aakmisc.dbname",NULL),
             port = getOption("aakmisc.port",5432),
             user = getOption("aakmisc.user",NULL),
             ...)
startTunnel(port = NULL,
            remotehost = getOption("aakmisc.remotehost",NULL),
            user = getOption("aakmisc.user",NULL),
            sleep = 5)
stopTunnel(..., pid = getOption("aakmisc.tunnelpid",NULL))

Arguments

host

Hostname on which to connect to the PostgreSQL server.

dbname

Name of PostgreSQL database.

port

Port on which to connect to PostgreSQL database. If NULL, a random port number will be used.

user

Username to use in conneting to PostgreSQL database. If NULL, Sys.getenv("USER") will be used.

mle

A data-frame of MLEs to be recorded.

files

Files containing R scripts to be recorded.

script

Name of script.

file

File to which the script will be written. See cat.

statement

SQL statement passed to dbGetQuery.

name, value

Name and contents of table to create.

overwrite, append, row.names

See dbWriteTable.

remotehost

Hostname of PostgreSQL server. An ssh tunnel to this host will be created.

pid

ID of ssh tunnel process. Set automatically by startTunnel.

sleep

Time in seconds to sleep after initiating the ssh tunnel.

...

Additional arguments will be passed to dbConnect.

Author(s)

Aaron A. King kingaa at umich dot edu

Examples

1
2
3
4
5
6
  ## Not run: 
startTunnel()
listScripts()
stopTunnel()
  
## End(Not run)

kingaa/aakmisc documentation built on Dec. 11, 2017, 10 a.m.