51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
|
// Code generated by sqlc. DO NOT EDIT.
|
||
|
// versions:
|
||
|
// sqlc v1.17.2
|
||
|
// source: merchant.sql
|
||
|
|
||
|
package db
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/google/uuid"
|
||
|
)
|
||
|
|
||
|
const getMerchantById = `-- name: GetMerchantById :one
|
||
|
SELECT id, index_id, name, owner_id, created_at, updated_at FROM merchants
|
||
|
WHERE id = $1
|
||
|
`
|
||
|
|
||
|
func (q *Queries) GetMerchantById(ctx context.Context, id uuid.UUID) (Merchant, error) {
|
||
|
row := q.db.QueryRowContext(ctx, getMerchantById, id)
|
||
|
var i Merchant
|
||
|
err := row.Scan(
|
||
|
&i.ID,
|
||
|
&i.IndexID,
|
||
|
&i.Name,
|
||
|
&i.OwnerID,
|
||
|
&i.CreatedAt,
|
||
|
&i.UpdatedAt,
|
||
|
)
|
||
|
return i, err
|
||
|
}
|
||
|
|
||
|
const getMerchantByUserId = `-- name: GetMerchantByUserId :one
|
||
|
SELECT id, index_id, name, owner_id, created_at, updated_at FROM merchants
|
||
|
WHERE owner_id = $1
|
||
|
`
|
||
|
|
||
|
func (q *Queries) GetMerchantByUserId(ctx context.Context, ownerID uuid.UUID) (Merchant, error) {
|
||
|
row := q.db.QueryRowContext(ctx, getMerchantByUserId, ownerID)
|
||
|
var i Merchant
|
||
|
err := row.Scan(
|
||
|
&i.ID,
|
||
|
&i.IndexID,
|
||
|
&i.Name,
|
||
|
&i.OwnerID,
|
||
|
&i.CreatedAt,
|
||
|
&i.UpdatedAt,
|
||
|
)
|
||
|
return i, err
|
||
|
}
|