Skip to content

Commit

Permalink
Postgres doesn't like collate by NOCASE. but it does it by default an…
Browse files Browse the repository at this point in the history
…yway so all good
  • Loading branch information
PartyWumpus authored and gbdlin committed Aug 8, 2024
1 parent 87a283a commit 823f026
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin_store/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy.exc import NoResultFound, SQLAlchemyError
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import collate, delete, select, update
from sqlalchemy.sql import delete, select, update

from constants import SortDirection, SortType

Expand Down Expand Up @@ -174,7 +174,7 @@ async def search(
direction = desc

if sort_by == SortType.NAME:
statement = statement.order_by(direction(collate(Artifact.name, "NOCASE")))
statement = statement.order_by(direction(Artifact.name))
elif sort_by == SortType.DATE:
statement = statement.order_by(direction(Artifact.created))
elif sort_by == SortType.DOWNLOADS:
Expand Down
1 change: 0 additions & 1 deletion tests/db_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import random

from contextlib import asynccontextmanager
from datetime import datetime, timedelta, UTC
from hashlib import sha256
Expand Down

0 comments on commit 823f026

Please sign in to comment.