Skip to content

Commit

Permalink
Merge pull request #25 from noneplugin/fix/sqlite-returning
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq authored Aug 27, 2023
2 parents 1cda631 + c661ad4 commit a46f70e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
dist/
.vscode/
.coverage
data/
data/
.env
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ def upgrade() -> None:
session_key_id_map[session_key] = session_obj.id

# 更新新插入的 session
for session_obj in session.scalars(
insert(SessionModel).returning(SessionModel),
session.execute(
insert(SessionModel),
[
session_dict
for key, session_dict in bulk_insert_sessions.items()
if key not in session_key_id_map # 去重
],
).all():
)
for session_obj in session.scalars(select(SessionModel)).all():
session_key = (
session_obj.bot_id,
session_obj.bot_type,
Expand Down

0 comments on commit a46f70e

Please sign in to comment.