diff options
| author | adamdottv <[email protected]> | 2025-05-13 13:08:43 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-13 13:08:43 -0500 |
| commit | 01b6bf5bb7307246cb2cca7f1cbc8aba693941cc (patch) | |
| tree | f47f5aa2b323ce8fea55f6999308486ff790d26e /internal/db/messages.sql.go | |
| parent | d8f3b606258a5655d73acc94d6cb37b421350817 (diff) | |
| download | opencode-01b6bf5bb7307246cb2cca7f1cbc8aba693941cc.tar.gz opencode-01b6bf5bb7307246cb2cca7f1cbc8aba693941cc.zip | |
chore: refactor db
Diffstat (limited to 'internal/db/messages.sql.go')
| -rw-r--r-- | internal/db/messages.sql.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/internal/db/messages.sql.go b/internal/db/messages.sql.go index 15ef7695b..57d940872 100644 --- a/internal/db/messages.sql.go +++ b/internal/db/messages.sql.go @@ -16,11 +16,9 @@ INSERT INTO messages ( session_id, role, parts, - model, - created_at, - updated_at + model ) VALUES ( - ?, ?, ?, ?, ?, strftime('%s', 'now'), strftime('%s', 'now') + ?, ?, ?, ?, ? ) RETURNING id, session_id, role, parts, model, created_at, updated_at, finished_at ` @@ -145,7 +143,7 @@ ORDER BY created_at ASC type ListMessagesBySessionAfterParams struct { SessionID string `json:"session_id"` - CreatedAt int64 `json:"created_at"` + CreatedAt string `json:"created_at"` } func (q *Queries) ListMessagesBySessionAfter(ctx context.Context, arg ListMessagesBySessionAfterParams) ([]Message, error) { @@ -185,14 +183,14 @@ UPDATE messages SET parts = ?, finished_at = ?, - updated_at = strftime('%s', 'now') + updated_at = strftime('%Y-%m-%dT%H:%M:%f000Z', 'now') WHERE id = ? ` type UpdateMessageParams struct { - Parts string `json:"parts"` - FinishedAt sql.NullInt64 `json:"finished_at"` - ID string `json:"id"` + Parts string `json:"parts"` + FinishedAt sql.NullString `json:"finished_at"` + ID string `json:"id"` } func (q *Queries) UpdateMessage(ctx context.Context, arg UpdateMessageParams) error { |
