Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support temporary tables #112

Closed
federico-razzoli opened this issue Mar 1, 2019 · 3 comments
Closed

Support temporary tables #112

federico-razzoli opened this issue Mar 1, 2019 · 3 comments

Comments

@federico-razzoli
Copy link

Support the syntax:

CREATE TEMPORARY TABLE t ( ... );

These tables only exist in the current session.

@federico-razzoli
Copy link
Author

If we drop a temporary table, while not mandatory, it is much safer to use this syntax:

DROP TEMPORARY TABLE t;

The reason is that some DBMSs (and probably SQL standard) allow to create a temp table with the same name of a regular table. The temporary table will shadow the other. But if it disappears (maybe because you disconnect and reconnect), DROP TABLE would kill the regular table...

@federico-razzoli
Copy link
Author

If task #16 is implemented, in PosgreSQL it would be nice to implement this SQL syntax:

ON COMMIT [ PRESERVE ROWS | DELETE ROWS | DROP ]

@FCO FCO added the enhancement New feature or request label Mar 1, 2019
FCO added a commit that referenced this issue Mar 12, 2019
@FCO
Copy link
Owner

FCO commented Mar 12, 2019

Now this is possible:

$ perl6 -Ilib -MRed -e '

model Bla is temp { has Int $.a is column }

my $*RED-DB = database "SQLite";

my $*RED-DEBUG = True;

Bla.^create-table;
'
SQL : CREATE TEMPORARY TABLE bla(
   a integer NOT NULL 
)
BIND: []

@Santec Could you please confirm if we can close this issue please?

@FCO FCO added this to backlog in Documenting Mar 27, 2019
@FCO FCO moved this from backlog to done in Documenting Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants