mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-20 14:40:16 +00:00
feat(db): get_score_best
This commit is contained in:
parent
3349620b3a
commit
c1f83eff55
@ -259,6 +259,14 @@ class Database(metaclass=Singleton):
|
|||||||
result = session.scalar(stmt)
|
result = session.scalar(stmt)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def get_score_best(self, song_id: str, rating_class: int):
|
||||||
|
stmt = select(ScoreBest).where(
|
||||||
|
(ScoreBest.song_id == song_id) & (ScoreBest.rating_class == rating_class)
|
||||||
|
)
|
||||||
|
with self.sessionmaker() as session:
|
||||||
|
result = session.scalar(stmt)
|
||||||
|
return result
|
||||||
|
|
||||||
def insert_score(self, score: Score):
|
def insert_score(self, score: Score):
|
||||||
with self.sessionmaker() as session:
|
with self.sessionmaker() as session:
|
||||||
session.add(score)
|
session.add(score)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user