Skip to content

Register a single frame as a table, using the given name

Description

Register a single frame as a table, using the given name

Usage

<SQLContext>$register(name, frame = NULL)

Arguments

name Name of the table.
frame Object to associate with this table name.

Value

An object of class “polars_sql_context”

Examples

library("polars")

df <- pl$DataFrame(x = 1)
ctx <- pl$SQLContext()
ctx$register("frame_data", df)$execute("SELECT * FROM frame_data")$collect()
#> shape: (1, 1)
#> ┌─────┐
#> │ x   │
#> │ --- │
#> │ f64 │
#> ╞═════╡
#> │ 1.0 │
#> └─────┘