Documentation ¶
Index ¶
Constants ¶
View Source
const QueryGetAll = `
SELECT id, full_name
FROM authors
WHERE
id > $1 AND
name LIKE '%' || $2 || '%'
ORDER BY id
FETCH NEXT $3 ROWS ONLY;`
View Source
const QueryGetDetail = `
SELECT full_name
FROM authors
WHERE id=$1;`
View Source
const QueryInsert = `
INSERT INTO
authors(full_name)
VALUES($1)
RETURNING id;`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Repository ¶
type Repository interface { // insert an author Insert(context.Context, *models.Author) error // get author detail GetById(ctx context.Context, id uint64) (*models.Author, error) // search + pagination (no detail) GetAll(ctx context.Context, encryptedCursor, search string, limit int) ([]models.Author, string, error) }
Click to show internal directories.
Click to hide internal directories.