connect_scrapebot: Connect to ScrapeBot database

Description Usage Arguments Details Value See Also Examples

View source: R/connect.R

Description

Connect to a ScrapeBot central database as typically provided during the installation process of a ScrapeBot infrastructure. Uses RMariaDB to connect to the MySQL server.

Usage

1
connect_scrapebot(credentials_section, credentials_file = "~/.scrapebot.ini")

Arguments

credentials_section

The section within your INI file holding the credentials. If write_scrapebot_credentials() was used to create the INI file, then the section is called "database on host" (e.g., "scrapebot on localhost").

credentials_file

The INI file to use. If write_scrapebot_credentials() was used to create the INI file, then it is called ~/.scrapebot.ini (the default). Note that the file must (!) be located inside your home directory (i.e., somewhere inside ~ as this is a required by https://mariadb.com/kb/en/configuring-mariadb-with-option-files/).

Details

In order not to use database credentials here, you need to set up an INI file containing your database credentials. You can do this by hand (see write_scrapebot_credentials()) or use the write_scrapebot_credentials() function.

Value

A connection object (i.e., a specified list), ready to be passed to other ScrapeBotR functions.

See Also

write_scrapebot_credentials() to help create the credentials file, disconnect() to close a database connection, https://github.com/MarHai/ScrapeBot for more information on the central database.

Examples

1
2
3
4
5
6
## Not run: 

connect_scrapebot('my_db on localhost')
connect_scrapebot('my_db on localhost', '~/my_own_credentials_file.ini')

## End(Not run)

MarHai/ScrapeBotR documentation built on March 10, 2021, 10:10 a.m.