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

Fix teardown in SQLite File spec #8918

Merged
merged 8 commits into from
Feb 5, 2024
9 changes: 7 additions & 2 deletions test/Table_Tests/src/Database/SQLite_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Metadata_Data
tinfo self = self.data.at 1
t self = self.data.at 2

setup create_connection_func =
setup create_connection_func = Metadata_Data.Value <|
connection = create_connection_func Nothing
tinfo = Name_Generator.random_name "Tinfo"
connection.execute_update 'CREATE TABLE "'+tinfo+'" ("strs" VARCHAR, "ints" INTEGER, "bools" BOOLEAN, "reals" REAL)'
Expand All @@ -51,10 +51,11 @@ type Metadata_Data
row3 = ["def", 42, True, 1.4]
Panic.rethrow <|
t.update_rows (Table.from_rows ["strs", "ints", "bools", "reals"] [row1, row2, row3]) update_action=Update_Action.Insert
Metadata_Data.Value [connection, tinfo, t]
[connection, tinfo, t]

teardown self =
self.connection.drop_table self.t.name
self.connection.drop_table self.tinfo
self.connection.close


Expand All @@ -80,6 +81,9 @@ type Tables_And_Table_Types_Data
[connection, tinfo, vinfo, temporary_table]

teardown self =
self.connection.drop_table self.tinfo
self.connection.drop_table self.vinfo
self.connection.drop_table self.temporary_table
self.connection.close


Expand Down Expand Up @@ -366,6 +370,7 @@ create_inmem_connection =


create_file_connection file =
file.delete_if_exists
connection = Database.connect (SQLite file)
connection.execute_update 'CREATE TABLE "Dummy" ("strs" VARCHAR, "ints" INTEGER, "bools" BOOLEAN, "reals" REAL)'
connection
Expand Down
Loading