diff options
Diffstat (limited to 'internal/data/notifications.sql.go')
| -rw-r--r-- | internal/data/notifications.sql.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/internal/data/notifications.sql.go b/internal/data/notifications.sql.go new file mode 100644 index 0000000..5819438 --- /dev/null +++ b/internal/data/notifications.sql.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.28.0 +// source: notifications.sql + +package data + +import ( + "context" + + "github.com/kyren223/eko/pkg/snowflake" +) + +const setLastReadMessage = `-- name: SetLastReadMessage :exec +INSERT INTO last_read_messages ( + user_id, source_id, last_read +) VALUES (?, ?, ?) +ON CONFLICT DO +UPDATE SET last_read = EXCLUDED.last_read +WHERE user_id = EXCLUDED.user_id AND source_id = EXCLUDED.source_id +` + +type SetLastReadMessageParams struct { + UserID snowflake.ID + SourceID snowflake.ID + LastRead int64 +} + +func (q *Queries) SetLastReadMessage(ctx context.Context, arg SetLastReadMessageParams) error { + _, err := q.db.ExecContext(ctx, setLastReadMessage, arg.UserID, arg.SourceID, arg.LastRead) + return err +} |
