Skip to content

Commit

Permalink
fix: detect full driver name before configuring engine (#149)
Browse files Browse the repository at this point in the history
chore: detect full driver name before configuring engine
  • Loading branch information
cofin authored Apr 9, 2024
1 parent 4f3e29e commit 9d3da13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def engine(self) -> AsyncEngine:
def get_engine(self) -> AsyncEngine:
if self._engine_instance is not None:
return self._engine_instance
if self.URL.startswith("postgres"):
if self.URL.startswith("postgresql+asyncpg"):
engine = create_async_engine(
url=self.URL,
future=True,
Expand Down Expand Up @@ -128,7 +128,7 @@ def decoder(bin_value: bytes) -> Any:
format="binary",
),
)
elif self.URL.startswith("sqlite"):
elif self.URL.startswith("sqlite+aiosqlite"):
engine = create_async_engine(
url=self.URL,
future=True,
Expand Down

0 comments on commit 9d3da13

Please sign in to comment.