1// Code generated by sqlc. DO NOT EDIT.
13const createSession = `-- name: CreateSession :one
34 strftime('%s', 'now'),
36) RETURNING id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
39type CreateSessionParams struct {
41 ParentSessionID sql.NullString `json:"parent_session_id"`
42 Title string `json:"title"`
43 MessageCount int64 `json:"message_count"`
44 PromptTokens int64 `json:"prompt_tokens"`
45 CompletionTokens int64 `json:"completion_tokens"`
46 Cost float64 `json:"cost"`
49func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) {
50 row := q.queryRow(ctx, q.createSessionStmt, createSession,
76const deleteSession = `-- name: DeleteSession :exec
81func (q *Queries) DeleteSession(ctx context.Context, id string) error {
82 _, err := q.exec(ctx, q.deleteSessionStmt, deleteSession, id)
86const getSessionByID = `-- name: GetSessionByID :one
87SELECT id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
92func (q *Queries) GetSessionByID(ctx context.Context, id string) (Session, error) {
93 row := q.queryRow(ctx, q.getSessionByIDStmt, getSessionByID, id)
111const listSessions = `-- name: ListSessions :many
112SELECT id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
114WHERE parent_session_id is NULL
115ORDER BY updated_at DESC
118func (q *Queries) ListSessions(ctx context.Context) ([]Session, error) {
119 rows, err := q.query(ctx, q.listSessionsStmt, listSessions)
142 items = append(items, i)
144 if err := rows.Close(); err != nil {
147 if err := rows.Err(); err != nil {
153const updateSession = `-- name: UpdateSession :one
158 completion_tokens = ?,
159 summary_message_id = ?,
163RETURNING id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
166type UpdateSessionParams struct {
167 Title string `json:"title"`
168 PromptTokens int64 `json:"prompt_tokens"`
169 CompletionTokens int64 `json:"completion_tokens"`
170 SummaryMessageID sql.NullString `json:"summary_message_id"`
171 Cost float64 `json:"cost"`
172 Todos sql.NullString `json:"todos"`
173 ID string `json:"id"`
176func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionParams) (Session, error) {
177 row := q.queryRow(ctx, q.updateSessionStmt, updateSession,
180 arg.CompletionTokens,
181 arg.SummaryMessageID,
203const updateSessionTitleAndUsage = `-- name: UpdateSessionTitleAndUsage :exec
207 prompt_tokens = prompt_tokens + ?,
208 completion_tokens = completion_tokens + ?,
213type UpdateSessionTitleAndUsageParams struct {
214 Title string `json:"title"`
215 PromptTokens int64 `json:"prompt_tokens"`
216 CompletionTokens int64 `json:"completion_tokens"`
217 Cost float64 `json:"cost"`
218 ID string `json:"id"`
221func (q *Queries) UpdateSessionTitleAndUsage(ctx context.Context, arg UpdateSessionTitleAndUsageParams) error {
222 _, err := q.exec(ctx, q.updateSessionTitleAndUsageStmt, updateSessionTitleAndUsage,
225 arg.CompletionTokens,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list