Adds a data source to the specified base on a NocoDB server via its
POST /api/v2/meta/bases/{id_base}/sources
API endpoint.
Usage
create_data_src(
connection,
id_integration = NULL,
type = c("mssql", "mysql", "pg", "sqlite3"),
alias = NULL,
inflection_column = c("none", "camelize"),
inflection_table = c("none", "camelize"),
is_schema_readonly = FALSE,
is_data_readonly = FALSE,
enabled = TRUE,
id_base = base_id(origin = origin, email = email, password = password, api_token =
api_token),
origin = pal::pkg_config_val("origin"),
email = pal::pkg_config_val("email"),
password = pal::pkg_config_val("password"),
api_token = pal::pkg_config_val("api_token")
)
Arguments
- connection
list()
Type-specific connection details for the data source.- id_integration
character(1)
Optional identifier of an existing NocoDB database integration as returned byintegration_id()
, of which to reuse connection details- type
character(1)
Type of the data source. One of"mssql"
,"mysql"
,"pg"
or"sqlite3"
.- alias
character(1)
Alias of the data source.- inflection_column
character(1)
Type of inflection to apply for column names in the data source. One of"none"
or"camelize"
.- inflection_table
character(1)
Type of inflection to apply for table names in the data source. One of"none"
or"camelize"
.- is_schema_readonly
logical(1)
Whether or not to forbid alterations of the data source's schema from NocoDB.- is_data_readonly
logical(1)
Whether or not to forbid alterations of the data source's data from NocoDB.- enabled
logical(1)
Whether the added data source is enabled or disabled.- id_base
character(1)
NocoDB base identifier as returned bybase_id()
.- origin
character(1)
NocoDB server origin.character(1)
E-mail address of the NocoDB user to authenticate with.- password
character(1)
Password of the NocoDB user to authenticate with.- api_token
character(1)
NocoDB API token. Takes precedence overemail
andpassword
if provided.
See also
Other functions to manage NocoDB base data sources:
create_data_src_tbl()
,
data_src()
,
data_src_diff()
,
data_src_id()
,
data_src_tbls()
,
data_srcs()
,
delete_data_src()
,
has_data_src_diff()
,
sync_data_src()
,
test_data_src()
,
update_data_src()
Examples
if (FALSE) { # \dontrun{
nocodb::create_data_src(type = "pg",
connection = list(host = "REPLACE-ME",
port = 5432,
ssl = list(ca = "",
cert = "",
key = ""),
sslmode = "verify-full",
user = "REPLACE-ME",
password = "REPLACE-ME",
database = "REPLACE-ME"),
alias = "REPLACE-ME",
inflection_column = "none",
inflection_table = "none")} # }