From f2e4d23cb08652085d8861bf068968edad489481 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Thu, 6 Oct 2022 13:01:07 +0200 Subject: [PATCH] Add support for creation of TEMP tables --- store/adapters/rdbms/ddl/commands.go | 6 +++++- store/adapters/rdbms/ddl/data_definer.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/store/adapters/rdbms/ddl/commands.go b/store/adapters/rdbms/ddl/commands.go index 4a9fc8d1c..32a43d2dc 100644 --- a/store/adapters/rdbms/ddl/commands.go +++ b/store/adapters/rdbms/ddl/commands.go @@ -93,8 +93,12 @@ func Exec(ctx context.Context, db sqlx.ExtContext, ss ...any) (err error) { } func (t *CreateTable) String() string { - sql := "CREATE TABLE " + sql := "CREATE " + if t.Table.Temporary { + sql += "TEMPORARY " + } + sql += "TABLE " if !t.OmitIfNotExistsClause { sql += "IF NOT EXISTS " } diff --git a/store/adapters/rdbms/ddl/data_definer.go b/store/adapters/rdbms/ddl/data_definer.go index e27ec5363..e21ef4604 100644 --- a/store/adapters/rdbms/ddl/data_definer.go +++ b/store/adapters/rdbms/ddl/data_definer.go @@ -42,6 +42,8 @@ type ( Indexes []*Index Comment string + Temporary bool + // implementation variations Meta map[string]interface{} }