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 getLastSession = `-- name: GetLastSession :one
87SELECT id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
89ORDER BY updated_at DESC
93func (q *Queries) GetLastSession(ctx context.Context) (Session, error) {
94 row := q.queryRow(ctx, q.getLastSessionStmt, getLastSession)
112const getSessionByID = `-- name: GetSessionByID :one
113SELECT id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
118func (q *Queries) GetSessionByID(ctx context.Context, id string) (Session, error) {
119 row := q.queryRow(ctx, q.getSessionByIDStmt, getSessionByID, id)
137const listSessions = `-- name: ListSessions :many
138SELECT id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
140WHERE parent_session_id is NULL
141ORDER BY updated_at DESC
144func (q *Queries) ListSessions(ctx context.Context) ([]Session, error) {
145 rows, err := q.query(ctx, q.listSessionsStmt, listSessions)
168 items = append(items, i)
170 if err := rows.Close(); err != nil {
173 if err := rows.Err(); err != nil {
179const renameSession = `-- name: RenameSession :exec
186type RenameSessionParams struct {
187 Title string `json:"title"`
188 ID string `json:"id"`
191func (q *Queries) RenameSession(ctx context.Context, arg RenameSessionParams) error {
192 _, err := q.exec(ctx, q.renameSessionStmt, renameSession, arg.Title, arg.ID)
196const updateSession = `-- name: UpdateSession :one
201 completion_tokens = ?,
202 summary_message_id = ?,
206RETURNING id, parent_session_id, title, message_count, prompt_tokens, completion_tokens, cost, updated_at, created_at, summary_message_id, todos
209type UpdateSessionParams struct {
210 Title string `json:"title"`
211 PromptTokens int64 `json:"prompt_tokens"`
212 CompletionTokens int64 `json:"completion_tokens"`
213 SummaryMessageID sql.NullString `json:"summary_message_id"`
214 Cost float64 `json:"cost"`
215 Todos sql.NullString `json:"todos"`
216 ID string `json:"id"`
219func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionParams) (Session, error) {
220 row := q.queryRow(ctx, q.updateSessionStmt, updateSession,
223 arg.CompletionTokens,
224 arg.SummaryMessageID,
246const updateSessionTitleAndUsage = `-- name: UpdateSessionTitleAndUsage :exec
250 prompt_tokens = prompt_tokens + ?,
251 completion_tokens = completion_tokens + ?,
253 updated_at = strftime('%s', 'now')
257type UpdateSessionTitleAndUsageParams struct {
258 Title string `json:"title"`
259 PromptTokens int64 `json:"prompt_tokens"`
260 CompletionTokens int64 `json:"completion_tokens"`
261 Cost float64 `json:"cost"`
262 ID string `json:"id"`
265func (q *Queries) UpdateSessionTitleAndUsage(ctx context.Context, arg UpdateSessionTitleAndUsageParams) error {
266 _, err := q.exec(ctx, q.updateSessionTitleAndUsageStmt, updateSessionTitleAndUsage,
269 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