회기 연속성과 멀티 케이스 계약을 영속화
This commit is contained in:
parent
be08c0b573
commit
72353ecd82
26 changed files with 2170 additions and 127 deletions
|
|
@ -119,10 +119,14 @@ class _ContractConnection:
|
|||
]
|
||||
matches.sort(key=lambda row: int(row["version"]), reverse=True)
|
||||
return matches[0] if matches else None
|
||||
if "FROM app.case_profile" in query and "FOR UPDATE" in query:
|
||||
return None
|
||||
if "INSERT INTO app.case_profile" in query:
|
||||
return {"case_id": self.case_id, "last_session_no": 0}
|
||||
if "UPDATE app.case_profile" in query:
|
||||
return {"last_session_no": int(args[1])}
|
||||
if "FROM app.sessions" in query and "ended_at IS NULL" in query:
|
||||
return None
|
||||
if "INSERT INTO app.sessions" in query:
|
||||
self.session_insert_args = args
|
||||
return {
|
||||
|
|
@ -140,7 +144,11 @@ class _ContractConnection:
|
|||
raise AssertionError(f"unexpected fetchrow: {query}")
|
||||
|
||||
async def execute(self, query: str, *args: Any) -> str:
|
||||
if "audit.audit_log" in query or "app.session_state" in query:
|
||||
if (
|
||||
"audit.audit_log" in query
|
||||
or "app.session_state" in query
|
||||
or "pg_advisory_xact_lock" in query
|
||||
):
|
||||
return "INSERT 0 1"
|
||||
raise AssertionError(f"unexpected execute: {query}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue