short/internal/db/query.sql.go

22 lines
432 B
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
// source: query.sql
package db
import (
"context"
)
const getURLByHash = `-- name: GetURLByHash :one
SELECT id, hash, long_url FROM urls
WHERE hash = $1
`
func (q *Queries) GetURLByHash(ctx context.Context, hash string) (Url, error) {
row := q.db.QueryRow(ctx, getURLByHash, hash)
var i Url
err := row.Scan(&i.ID, &i.Hash, &i.LongUrl)
return i, err
}