Skip to content

Commit

Permalink
Clean table/types if exist before running test
Browse files Browse the repository at this point in the history
  • Loading branch information
gregszero committed Nov 20, 2024
1 parent 7f52c35 commit 0bc9440
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/duckdb_test/column_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def test_name
def create_data
@@db ||= DuckDB::Database.open # FIXME
con = @@db.connect

con.query(drop_table_sql)
con.query(drop_type_enum_sql)

con.query(create_type_enum_sql)
con.query(create_table_sql)
con.query(insert_sql)
Expand All @@ -95,7 +99,7 @@ def create_type_enum_sql

def create_table_sql
sql = <<-SQL
CREATE TABLE table1(
CREATE TABLE IF NOT EXISTS table1(
boolean_col BOOLEAN,
tinyint_col TINYINT,
smallint_col SMALLINT,
Expand Down Expand Up @@ -161,5 +165,13 @@ def insert_sql
sql += ')'
sql
end

def drop_type_enum_sql
"DROP TYPE IF EXISTS mood;"
end

def drop_table_sql
"DROP TABLE IF EXISTS table1;"
end
end
end

0 comments on commit 0bc9440

Please sign in to comment.