Skip to content

Commit

Permalink
fix(duckdb): ensure that current_database returns the correct value
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 2, 2023
1 parent 867e5f1 commit 2039b1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ class Backend(BaseAlchemyBackend, AlchemyCanCreateSchema):
compiler = DuckDBSQLCompiler
supports_create_or_replace = True

@property
def current_database(self) -> str:
return "main"
query = sa.select(sa.func.current_database())
with self.begin() as con:
return con.execute(query).scalar()

@staticmethod
def _convert_kwargs(kwargs: MutableMapping) -> None:
Expand Down

0 comments on commit 2039b1e

Please sign in to comment.