43 lines
983 B
Go
43 lines
983 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.19.1
|
|
// source: queries.sql
|
|
|
|
package store
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const addItem = `-- name: AddItem :exec
|
|
INSERT OR REPLACE INTO replied_items (id, item_type, updated_time) VALUES (?, ?, ?)
|
|
`
|
|
|
|
type AddItemParams struct {
|
|
ID int64
|
|
ItemType string
|
|
UpdatedTime int64
|
|
}
|
|
|
|
func (q *Queries) AddItem(ctx context.Context, arg AddItemParams) error {
|
|
_, err := q.db.ExecContext(ctx, addItem, arg.ID, arg.ItemType, arg.UpdatedTime)
|
|
return err
|
|
}
|
|
|
|
const itemExists = `-- name: ItemExists :one
|
|
SELECT COUNT(1) FROM replied_items WHERE item_type = ? AND id = ? AND updated_time = ?
|
|
`
|
|
|
|
type ItemExistsParams struct {
|
|
ItemType string
|
|
ID int64
|
|
UpdatedTime int64
|
|
}
|
|
|
|
func (q *Queries) ItemExists(ctx context.Context, arg ItemExistsParams) (int64, error) {
|
|
row := q.db.QueryRowContext(ctx, itemExists, arg.ItemType, arg.ID, arg.UpdatedTime)
|
|
var count int64
|
|
err := row.Scan(&count)
|
|
return count, err
|
|
}
|