get_table {SCDB}R Documentation

Retrieves a named table from a given schema on the connection

Description

Retrieves a named table from a given schema on the connection

Usage

get_table(conn, db_table = NULL, slice_ts = NA, include_slice_info = FALSE)

Arguments

conn

(DBIConnection(1))
Connection object.

db_table

(⁠id-like object(1)⁠)
A table specification (coercible by id()). If missing, a list of available tables is printed.

slice_ts

(POSIXct(1), Date(1), or character(1))
If set different from NA (default), the returned data looks as on the given date. If set as NULL, all data is returned.

include_slice_info

(logical(1))
Should the history columns "checksum", "from_ts", "until_ts" are also be returned?

Value

A "lazy" data.frame (tbl_lazy) generated using dbplyr.

Note that a temporary table will be preferred over ordinary tables in the default schema (see get_schema()) with an identical name.

Examples


  conn <- get_connection()

  dplyr::copy_to(conn, mtcars, name = "mtcars", temporary = FALSE)

  get_table(conn)
  if (table_exists(conn, "mtcars")) {
    get_table(conn, "mtcars")
  }

  close_connection(conn)


[Package SCDB version 0.4.0 Index]