Initial commit
This commit is contained in:
28
backend/internal/db/query.sql.go
Normal file
28
backend/internal/db/query.sql.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user