feat: add first query
This commit is contained in:
parent
2dd5f6fa60
commit
cc6ac32324
1 changed files with 26 additions and 0 deletions
26
internal/store/pgstore/queries.sql.go
Normal file
26
internal/store/pgstore/queries.sql.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.27.0
|
||||
// source: queries.sql
|
||||
|
||||
package pgstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const getRoom = `-- name: GetRoom :one
|
||||
SELECT
|
||||
"id", "theme"
|
||||
FROM rooms
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetRoom(ctx context.Context, id uuid.UUID) (Room, error) {
|
||||
row := q.db.QueryRow(ctx, getRoom, id)
|
||||
var i Room
|
||||
err := row.Scan(&i.ID, &i.Theme)
|
||||
return i, err
|
||||
}
|
||||
Loading…
Reference in a new issue