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