Skip to contents

Tests a data source's connection details via a NocoDB server's POST /api/v2/meta/connection/test API endpoint.

Usage

test_data_src(
  connection,
  type = c("mssql", "mysql", "pg", "sqlite3"),
  hostname = pal::pkg_config_val("hostname"),
  email = pal::pkg_config_val("email"),
  password = pal::pkg_config_val("password"),
  api_token = pal::pkg_config_val("api_token"),
  quiet = FALSE
)

Arguments

connection

Type-specific connection details for the data source. A list.

type

Type of the data source. One of "mssql", "mysql", "pg" or "sqlite3".

hostname

NocoDB server hostname. A character scalar.

email

E-mail address of the NocoDB user to authenticate with.

password

Password of the NocoDB user to authenticate with.

api_token

NocoDB API token. Takes precedence over email and password if provided.

quiet

Whether or not to suppress printing status output from internal processing.

Value

A logical scalar indicating whether the connection test was successful or not.

Details

Note that the PostgreSQL connection parameters sslmode and database have no effect, i.e. are simply ignored by the API endpoint.

See also

Examples

if (FALSE) { # \dontrun{
nocodb::test_data_src(type = "pg",
                      connection = list(host = "REPLACE-ME",
                                        port = 5432L,
                                        ssl = TRUE,
                                        user = "REPLACE-ME",
                                        password = "REPLACE-ME"))} # }