Commit 8b988258 authored by Enrico Schumann's avatar Enrico Schumann

[DESCRIPTION] Move package DBI to Suggests

parent 9fa0f5d9
2019-02-14 Enrico Schumann <es@enricoschumann.net>
* DESCRIPTION (Imports, Suggests): move package
DBI to Suggests
2018-11-21 Enrico Schumann <es@enricoschumann.net>
* R/functions.R (write_ts_table): fix 'add' for
......
......@@ -2,7 +2,7 @@ Package: tsdb
Type: Package
Title: Terribly-Simple Data Base for Time Series
Version: 0.6-0
Date: 2018-11-21
Date: 2019-02-14
Maintainer: Enrico Schumann <es@enricoschumann.net>
Authors@R: person(given = "Enrico", family = "Schumann",
role = c("aut", "cre"),
......@@ -13,5 +13,5 @@ Description: A terribly-simple data base for numeric time
offers utilities for saving files in a standardised
format, and for retrieving and joining data.
License: GPL-3
Imports: DBI, datetimeutils, fastmatch, utils, zoo
Suggests: MonetDBLite
Imports: datetimeutils, fastmatch, utils, zoo
Suggests: DBI, MonetDBLite
......@@ -7,13 +7,13 @@ export(
write_ts_table
)
importFrom("DBI",
"dbConnect",
"dbDisconnect",
"dbGetQuery",
"dbQuoteIdentifier",
"dbWriteTable"
)
## importFrom("DBI",
## "dbConnect",
## "dbDisconnect",
## "dbGetQuery",
## "dbQuoteIdentifier",
## "dbWriteTable"
## )
importFrom("datetimeutils",
"is_businessday",
......
......@@ -132,14 +132,14 @@ write_ts_table <- function(ts, dir, file,
} else if (backend == "monetdb") {
if (!inherits(dir, "MonetDBEmbeddedConnection")) {
dir <- dbConnect(MonetDBLite::MonetDBLite(), dir)
on.exit(dbDisconnect(dir, shutdown = TRUE))
dir <- DBI::dbConnect(MonetDBLite::MonetDBLite(), dir)
on.exit(DBI::dbDisconnect(dir, shutdown = TRUE))
}
df <- data.frame(timestamp, unclass(ts))
colnames(df) <- c("timestamp", columns)
dbWriteTable(dir, dbQuoteIdentifier(dir, file), df,
overwrite = overwrite)
DBI::dbWriteTable(dir, DBI::dbQuoteIdentifier(dir, file), df,
overwrite = overwrite)
} else
stop("unknown backend")
......@@ -271,11 +271,11 @@ read_ts_tables <- function(file, dir, t.type = "guess",
### ********************
if (!inherits(dir, "MonetDBEmbeddedConnection")) {
dir <- dbConnect(MonetDBLite::MonetDBLite(), dir)
on.exit(dbDisconnect(dir, shutdown = TRUE))
dir <- DBI::dbConnect(MonetDBLite::MonetDBLite(), dir)
on.exit(DBI::dbDisconnect(dir, shutdown = TRUE))
}
dbGetQuery(dir, "SELECT * FROM file;")
DBI::dbGetQuery(dir, "SELECT * FROM file;")
} else
stop("unknown backend")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment