getting chirps!

This commit is contained in:
2025-03-11 19:33:53 +02:00
parent de5f090a9c
commit bd6583831c
6 changed files with 182 additions and 15 deletions

View File

@@ -0,0 +1,29 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
// source: GetChirpByID.sql
package database
import (
"context"
"github.com/google/uuid"
)
const getChirpByID = `-- name: GetChirpByID :one
SELECT id, created_at, updated_at, body, user_id FROM chirps WHERE id = $1
`
func (q *Queries) GetChirpByID(ctx context.Context, id uuid.UUID) (Chirp, error) {
row := q.db.QueryRowContext(ctx, getChirpByID, id)
var i Chirp
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Body,
&i.UserID,
)
return i, err
}