29 lines
612 B
Go
29 lines
612 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
// source: query.sql
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const createFoodItem = `-- name: CreateFoodItem :one
|
|
INSERT INTO food_items(title, description)
|
|
VALUES ($1, $2)
|
|
RETURNING guid, title, description
|
|
`
|
|
|
|
type CreateFoodItemParams struct {
|
|
Title string
|
|
Description string
|
|
}
|
|
|
|
func (q *Queries) CreateFoodItem(ctx context.Context, arg CreateFoodItemParams) (FoodItem, error) {
|
|
row := q.db.QueryRow(ctx, createFoodItem, arg.Title, arg.Description)
|
|
var i FoodItem
|
|
err := row.Scan(&i.Guid, &i.Title, &i.Description)
|
|
return i, err
|
|
}
|