PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
203 stars 235 forks source link

Change settings database/username to database/user #89

Closed dlebauer closed 10 years ago

dlebauer commented 10 years ago

since R arguments use partial matching, user will work for both the MySQL and PostgreSQL drivers.

Need to

  1. Update wiki page (https://github.com/PecanProject/pecan/wiki/PEcAn-Configuration#functions)
  2. find and update all test settings files: find . -name "*.xml" | xargs grep username

related to redmine 1860

dlebauer commented 10 years ago

Here they all are. Presumably I could just pass a sed 's/username/user/g instead of grep username below. .. that doesn't exactly work...

desktop:~/R-dev/pecan$ find . -name "*.xml" | xargs grep username
./db/inst/tests/pecan.xml:    <username>bety</username>
./db/inst/tests/pecan.sipnet.xml:    <username>bety</username>
./models/biocro/vignettes/pecan.xml:  <username>bety</username>
./models/biocro/inst/extdata/saof.xml:    <username>bety</username>
./models/biocro/inst/extdata/pecan.biocro.xml:    <username>bety</username>
./models/biocro/inst/extdata/pecan.xml:  <username>bety</username>
./models/biocro/inst/tests/pecan.xml:  <username>bety</username>
./utils/inst/extdata/test.settings.xml:    <username>bety</username>
./utils/inst/tests/pecan.xml:  <username>bety</username>
./pecan.xml:  <username>bety</username>
./tests/pecan.dalec.xml:    <username>bety</username>
./tests/pecan.biocro.xml:    <username>bety</username>
./tests/pecan.ed.xml:  <username>bety</username>
./tests/pecan.xml:    <username>bety</username>
./tests/pecan.sipnet.xml:    <username>bety</username>
robkooper commented 10 years ago

Just as an FYI the check.settings function will do a bunch of conversions if needed and print a warning:

MySQL userid -> username user -> username

PostgreSQL userid -> user username -> user

Both passwd -> password name -> dbname

dlebauer commented 10 years ago

Since R uses partial matching, an argument user will match both the user and username arguments of RPosgreSQL and RMySQL, respectively. If we change 'username' to user, we will would only have to do userid -> user, and this is database agnostic. I will also simplify the check.settings function