write_dataset_into_ssdb: Append "dataset" to a SumavaDB-like spatiotemporal database

View source: R/write_dataset_into_ssdb.R

write_dataset_into_ssdbR Documentation

Append "dataset" to a SumavaDB-like spatiotemporal database

Description

Append "dataset" to a SumavaDB-like spatiotemporal database

Usage

write_dataset_into_ssdb(
  conn,
  dataset,
  append = TRUE,
  new = FALSE,
  sql_files = system.file("sql/create_or_replace_functions.sql", package = "SuSnowDB"),
  ...
)

Arguments

conn

database (preferrably PodtgresSQL) connection. See ouput of dbConnect.

dataset

dataset . See output of sumava_snow_dataset

append

logical. If append==FALSE database tables are created or replaced. If append==FALSE data and metedata are appended as new rows of the database tables. Default is append=TRUE.

new

logical. If new==TRUE database tables are created or replaced. If new==FALSE tables are modidied according to append. Default is FALSE.

sql_files

file names containing database initialization SQL queries. They are used in case append==FALSE or new=TRUE.

...

further arguments.

Examples

## Not run: 
library(RPostgreSQL) 

val <- sumava_snow_dataset()
dbname = "hydroclimatedb_ver03"
conn = dbConnect(PostgreSQL(), dbname = dbname)

## Create a new DB layout
write_dataset_into_ssdb(conn,dataset=val,new=TRUE)
dbDisconnect(conn) 

## End(Not run)

ecor/SuSnowDB documentation built on Jan. 2, 2023, midnight