From 10afc989ca689d8c497808b35494c93d6e288ad4 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 23 May 2024 11:41:20 -0400 Subject: [PATCH] test(duckdb): test multiple connections to named in-memory db (#9242) --- ibis/backends/duckdb/tests/test_client.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ibis/backends/duckdb/tests/test_client.py b/ibis/backends/duckdb/tests/test_client.py index 6665615a237e..a0a9fcc3897b 100644 --- a/ibis/backends/duckdb/tests/test_client.py +++ b/ibis/backends/duckdb/tests/test_client.py @@ -304,3 +304,19 @@ def test_settings_repr(): view = repr(con.settings) assert "name" in view assert "value" in view + + +def test_connect_named_in_memory_db(): + con_named_db = ibis.duckdb.connect(":memory:mydb") + + con_named_db.create_table("ork", schema=ibis.schema(dict(bork="int32"))) + assert "ork" in con_named_db.list_tables() + + con_named_db_2 = ibis.duckdb.connect(":memory:mydb") + assert "ork" in con_named_db_2.list_tables() + + unnamed_memory_db = ibis.duckdb.connect(":memory:") + assert "ork" not in unnamed_memory_db.list_tables() + + default_memory_db = ibis.duckdb.connect() + assert "ork" not in default_memory_db.list_tables()