Skip to contents

List views of a table

Usage

hb_list_views(x, table, ...)

# S3 method for class 'harbour_dtable'
hb_list_views(x, table, ...)

# Default S3 method
hb_list_views(x, table, ...)

# S3 method for class 'harbour_client'
hb_list_views(x, table, ..., refresh = FALSE)

Arguments

x

A harbour_client connected to a base, or a harbour_dtable read from a local file.

table

Table name.

...

These dots are for future extensions and must be empty.

refresh

Logical. Ask the server rather than reusing the cached base metadata. Default FALSE.

Value

A tibble with columns name (chr), type (chr) and is_default (lgl). Zero rows if no views exist.

Examples

# a .dtable file needs no server
path <- system.file("extdata", "example.dtable", package = "harbouR")
hb_list_views(hb_read_dtable(path), "Samples")
#> # A tibble: 1 × 3
#>   name         type  is_default
#>   <chr>        <chr> <lgl>     
#> 1 Default View table TRUE      

# a live base needs a SeaTable server and an API token
if (FALSE) { # \dontrun{
client <- hb_client()
hb_list_views(client, "Samples")
} # }