-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquerier.go
More file actions
81 lines (77 loc) · 2.79 KB
/
querier.go
File metadata and controls
81 lines (77 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package mysqldb
import (
"context"
"database/sql"
)
type Querier interface {
// INSERT INTO book_tags (`book_id`, `tag_id`) VALUES (?, ?)
//
// INSERT INTO book_tags (`book_id`, `tag_id`)
// VALUES (?, ?)
AddBookTag(ctx context.Context, arg AddBookTagParams) error
// INSERT INTO book_tags (`book_id`, `tag_id`) VALUES (?, ?)
// @bulk-for AddBookTag
//
// INSERT INTO book_tags (`book_id`, `tag_id`)
// VALUES (?, ?)
AddBookTags(ctx context.Context, arg AddBookTagsParams) error
// INSERT INTO books (`title`, `author`, `description`) VALUES (?, ?, ?)
//
// INSERT INTO books (`title`, `author`, `description`)
// VALUES (?, ?, ?)
CreateBook(ctx context.Context, arg CreateBookParams) (sql.Result, error)
// INSERT INTO tags (`name`) VALUES (?)
//
// INSERT INTO tags (`name`)
// VALUES (?)
CreateTag(ctx context.Context, name string) (sql.Result, error)
// DELETE FROM books WHERE id = ?
//
// DELETE FROM books
// WHERE id = ?
DeleteBook(ctx context.Context, id int64) error
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at` FROM books WHERE id = ?
//
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at`
// FROM books
// WHERE id = ?
GetBook(ctx context.Context, id int64) (Book, error)
// SELECT t.`id`, t.`name`, t.`created_at`, t.`updated_at` FROM tags t INNER JOIN book_tags bt ON t.id = bt.tag_id WHERE bt.book_id = ?
//
// SELECT t.`id`, t.`name`, t.`created_at`, t.`updated_at`
// FROM tags t
// INNER JOIN book_tags bt ON t.id = bt.tag_id
// WHERE bt.book_id = ?
GetBookTags(ctx context.Context, bookID int64) ([]Tag, error)
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at` FROM books WHERE author = ?
//
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at`
// FROM books
// WHERE `author` = ?
GetBooksByAuthor(ctx context.Context, author string) ([]Book, error)
// SELECT `id`, `name`, `created_at`, `updated_at` FROM tags WHERE id = ?
//
// SELECT `id`, `name`, `created_at`, `updated_at`
// FROM tags
// WHERE id = ?
GetTag(ctx context.Context, id int64) (Tag, error)
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at` FROM books ORDER BY title
//
// SELECT `id`, `title`, `author`, `description`, `created_at`, `updated_at`
// FROM books
// ORDER BY `title`
ListBooks(ctx context.Context) ([]Book, error)
// UPDATE books SET `title` = ?, `author` = ?, `description` = ?, `updated_at` = NOW() WHERE id = ?
//
// UPDATE books
// SET `title` = ?,
// `author` = ?,
// `description` = ?,
// `updated_at` = NOW()
// WHERE id = ?
UpdateBook(ctx context.Context, arg UpdateBookParams) (sql.Result, error)
}
var _ Querier = (*Queries)(nil)