fix: AI review loading UX and Gate preview snapshot time filter SQL
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -92,9 +92,14 @@ def sql_list_time_field(*columns):
|
||||
"""
|
||||
SQLite 列表时间窗比较表达式。
|
||||
journal_entries 的 open/close 可能含 'T',直接与 bounds(空格格式)比会误判为超出上界。
|
||||
单列时不用 COALESCE(SQLite 要求 COALESCE 至少 2 个参数)。
|
||||
"""
|
||||
cols = ", ".join(columns)
|
||||
return f"REPLACE(COALESCE({cols}), 'T', ' ')"
|
||||
cols = [c for c in columns if c]
|
||||
if not cols:
|
||||
raise ValueError("sql_list_time_field requires at least one column")
|
||||
if len(cols) == 1:
|
||||
return f"REPLACE({cols[0]}, 'T', ' ')"
|
||||
return f"REPLACE(COALESCE({', '.join(cols)}), 'T', ' ')"
|
||||
|
||||
|
||||
SESSION_KEY_LIST_WIN = "list_win_filter"
|
||||
|
||||
Reference in New Issue
Block a user