Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignMaintainer ¶
AssignMaintainer assigns a maintainer (ai_names.id) to a session (sessions.id). Uses UPSERT — replaces any existing assignment for that session.
func CreateOrGetSessionID ¶
CreateOrGetSessionID 获取或创建会话ID
func GetCurrentSessionID ¶
GetCurrentSessionID 获取当前会话ID(线程安全,仅初始化一次)
func ResetSessionID ¶
func ResetSessionID()
ResetSessionID clears the cached session ID so the next call to GetCurrentSessionID will re-resolve against the current database. Intended for tests that switch database paths.
func UpdateProjectPath ¶
UpdateProjectPath updates the project_path for a given session. Returns an error if the session does not exist or the path is empty.
Types ¶
type ProjectRow ¶
type ProjectRow struct {
ID int64
ProjectPath string
CreatedAt string
MaintainerCN string // e.g. "玻尔" or empty
MaintainerEN string // e.g. "Bohr" or empty
MaintainerID int64 // ai_names.id, 0 if none
}
ProjectRow represents a row from the sessions table.
func ListProjects ¶
func ListProjects() ([]ProjectRow, error)
ListProjects returns all sessions with their maintainer, ordered by ID.