Skip to content

Commit

Permalink
Use case insensitive comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Sep 15, 2023
1 parent 9f7f335 commit 50504d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fastapi_server/models/chat_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def table_exists(table_name: str) -> bool:
# pyre-fixme[11]
data: Record = await conn.fetchrow(
f"""
SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '{table_name}');
SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name ILIKE '{table_name}');
"""
)
return data.get("exists")
Expand Down
2 changes: 1 addition & 1 deletion fastapi_server/models/todo_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def table_exists(table_name: str) -> bool:
# pyre-fixme[11]
data: Record = await conn.fetchrow(
f"""
SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '{table_name}');
SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name ILIKE '{table_name}');
"""
)
return data.get("exists")
Expand Down

0 comments on commit 50504d7

Please sign in to comment.