Skip to content

Allow for CREATE TEMP TABLE #415

@teunbrand

Description

@teunbrand

I'd like to be able to do this, and maybe re-use the data table later.

CREATE TEMP TABLE data(x, y) AS (VALUES
  ('A', 5),
  ('B', 2),
  ('C', 4),
  ('D', 7),
  ('E', 6)
)
VISUALISE x, y FROM data
DRAW area
#> Failed to execute query: Data source error: Failed to execute SQL: Parser Error: syntax error at or near "CREATE"
#> LINE 1: ... TABLE "__ggsql_global_cab3d805ac3f47ef93a49a892627e943__" AS CREATE TEMP TABLE data(x, y) AS
#> (VALUES

Currently our options are:

  • Use CTE, e.g. WITH data(x, y) AS (VALUES ...). But that doesn't allow you to re-use the data later.
  • If you're working in a jupyter notebook, you can split the SQL part from the visualise part and run them in separate cells. This is suboptimal in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    readerConcerns the reader arm of ggsql.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions