to_sql | R Documentation |
Function to_sql(df, name, dbname, schemaname, if_exists, index, index_label, nanoseconds). Creates table in the connected nuvolos schema from an R dataframe. On Nuvolos the database and schema are by default the ones the user is working in, from local machine they need to be specified. The function supports bulk loading.
to_sql(
df,
name,
dbname = NULL,
schemaname = NULL,
if_exists = "fail",
index = TRUE,
index_label = NULL,
nanoseconds = FALSE
)
df |
Name of the R dataframe to be written to a table. |
name |
The name of the database table. It will only be quoted and case sensitive if it contains keywords or special chars |
dbname |
The name of the database to which data will be inserted. |
schemaname |
The name of the schema to which data will be inserted. |
if_exists |
How to behave if the table already exists. ‘fail’, ‘replace’, ‘append’, default ‘fail’
|
index |
bool, default True: Write DataFrame index as a column. Uses index_label as the column name in the table. |
index_label |
column label for index column(s). If None is given (default) and index is True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. |
nanoseconds |
if True, nanosecond timestamps will be used to upload the data. Limits timestamp range from 1677-09-21 00:12:43.145224192 to 2262-04-11 23:47:16.854775807. |
to_sql(df = df, name = "table", if_exists = 'replace', index = FALSE)
to_sql(df = df, name = "table", dbname = "space_1", schemaname = "test_schema", if_exists = 'replace', index = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.