Documentation ¶
Overview ¶
Package master contains the sqlite database schema
Index ¶
- Variables
- type DeleteHTMLByIDParams
- type DeleteSelectorByIDParams
- type DeleteURLParams
- type GetSelectorByIDParams
- type GetSelectorByValueParams
- type GetSelectorsByContextParams
- type GetSelectorsByURLParams
- type GetURLByValueParams
- type Html
- type InsertHTMLParams
- type InsertSelectorParams
- type InsertURLParams
- type ListAllRow
- type Queries
- func (q *Queries) DeleteHTMLByID(ctx context.Context, arg DeleteHTMLByIDParams) error
- func (q *Queries) DeleteSelectorByID(ctx context.Context, arg DeleteSelectorByIDParams) error
- func (q *Queries) DeleteURL(ctx context.Context, arg DeleteURLParams) error
- func (q *Queries) GetSelectorByID(ctx context.Context, arg GetSelectorByIDParams) (*Selector, error)
- func (q *Queries) GetSelectorByValue(ctx context.Context, arg GetSelectorByValueParams) (*Selector, error)
- func (q *Queries) GetSelectorsByContext(ctx context.Context, arg GetSelectorsByContextParams) ([]*Selector, error)
- func (q *Queries) GetSelectorsByURL(ctx context.Context, arg GetSelectorsByURLParams) ([]*Selector, error)
- func (q *Queries) GetURLByValue(ctx context.Context, arg GetURLByValueParams) (*Url, error)
- func (q *Queries) InsertHTML(ctx context.Context, arg InsertHTMLParams) (*Html, error)
- func (q *Queries) InsertSelector(ctx context.Context, arg InsertSelectorParams) (*Selector, error)
- func (q *Queries) InsertURL(ctx context.Context, arg InsertURLParams) (*Url, error)
- func (q *Queries) ListAll(ctx context.Context) ([]*ListAllRow, error)
- func (q *Queries) ListHTMLs(ctx context.Context) ([]*Html, error)
- func (q *Queries) ListURLs(ctx context.Context) ([]*Url, error)
- func (q *Queries) UpdateHTMLByID(ctx context.Context, arg UpdateHTMLByIDParams) (*Html, error)
- func (q *Queries) UpdateSelectorByID(ctx context.Context, arg UpdateSelectorByIDParams) error
- func (q *Queries) UpdateURL(ctx context.Context, arg UpdateURLParams) error
- func (q *Queries) UpsertURL(ctx context.Context, arg UpsertURLParams) (*Url, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Selector
- type UpdateHTMLByIDParams
- type UpdateSelectorByIDParams
- type UpdateURLParams
- type UpsertURLParams
- type Url
Constants ¶
This section is empty.
Variables ¶
var MasterSchema string
MasterSchema is the schema for the main database
Functions ¶
This section is empty.
Types ¶
type DeleteHTMLByIDParams ¶
type DeleteHTMLByIDParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteSelectorByIDParams ¶
type DeleteSelectorByIDParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteURLParams ¶
type DeleteURLParams struct {
ID int64 `db:"id" json:"id"`
}
type GetSelectorByIDParams ¶
type GetSelectorByIDParams struct {
ID int64 `db:"id" json:"id"`
}
type GetSelectorByValueParams ¶
type GetSelectorByValueParams struct {
Value string `db:"value" json:"value"`
}
type GetSelectorsByContextParams ¶
type GetSelectorsByContextParams struct {
Context string `db:"context" json:"context"`
}
type GetSelectorsByURLParams ¶
type GetSelectorsByURLParams struct {
Value string `db:"value" json:"value"`
}
type GetURLByValueParams ¶
type GetURLByValueParams struct {
Value string `db:"value" json:"value"`
}
type InsertHTMLParams ¶
type InsertHTMLParams struct {
Value string `db:"value" json:"value"`
}
type InsertSelectorParams ¶
type InsertURLParams ¶
type ListAllRow ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries is the object to use to interact with the database.
func (*Queries) DeleteHTMLByID ¶
func (q *Queries) DeleteHTMLByID(ctx context.Context, arg DeleteHTMLByIDParams) error
DeleteHTMLByID
DELETE FROM htmls WHERE id = ?
func (*Queries) DeleteSelectorByID ¶
func (q *Queries) DeleteSelectorByID(ctx context.Context, arg DeleteSelectorByIDParams) error
DeleteSelectorByID
DELETE FROM selectors WHERE id = ?
func (*Queries) DeleteURL ¶
func (q *Queries) DeleteURL(ctx context.Context, arg DeleteURLParams) error
DeleteURL
DELETE FROM urls WHERE id = ?
func (*Queries) GetSelectorByID ¶
func (q *Queries) GetSelectorByID(ctx context.Context, arg GetSelectorByIDParams) (*Selector, error)
GetSelectorByID
SELECT id, value, url_id, context FROM selectors WHERE id = ?
func (*Queries) GetSelectorByValue ¶
func (q *Queries) GetSelectorByValue(ctx context.Context, arg GetSelectorByValueParams) (*Selector, error)
GetSelectorByValue
SELECT id, value, url_id, context FROM selectors WHERE value = ?
func (*Queries) GetSelectorsByContext ¶
func (q *Queries) GetSelectorsByContext(ctx context.Context, arg GetSelectorsByContextParams) ([]*Selector, error)
GetSelectorsByContext
SELECT id, value, url_id, context FROM selectors WHERE context = ?
func (*Queries) GetSelectorsByURL ¶
func (q *Queries) GetSelectorsByURL(ctx context.Context, arg GetSelectorsByURLParams) ([]*Selector, error)
GetSelectorsByURL
SELECT selectors.id, selectors.value, selectors.url_id, selectors.context FROM selectors JOIN urls ON urls.id = selectors.url_id WHERE urls.value = ?
func (*Queries) InsertHTML ¶
InsertHTML
INSERT INTO htmls (value) VALUES (?) RETURNING id, value, updated_at, created_at
func (*Queries) InsertSelector ¶
**************************************************************************** ****************************************************************************
/* ** selectors.sql ** Description: This file contains the SQLite queries for the selectors table ** Dialect: sqlite3 */ INSERT INTO selectors (value, url_id, context) VALUES (?, ?, ?) RETURNING id, value, url_id, context
func (*Queries) InsertURL ¶
InsertURL
INSERT INTO urls (value, html_id) VALUES (?, ?) RETURNING id, value, html_id
func (*Queries) ListAll ¶
func (q *Queries) ListAll(ctx context.Context) ([]*ListAllRow, error)
ListAll
SELECT urls.id, urls.value, htmls.value as html, selectors.value as selector FROM urls JOIN htmls ON urls.html_id = htmls.id JOIN selectors ON urls.id = selectors.url_id
func (*Queries) ListHTMLs ¶
****************************************************************************
/* ** File: htmls.sql ** Description: This file contains the SQLite queries for the htmls table ** Dialect: sqlite3 */ SELECT id, value, updated_at, created_at from htmls
func (*Queries) ListURLs ¶
**************************************************************************** ****************************************************************************
/* ** File: urls.sql ** Description: This file contains the SQLite queries for the urls table ** Dialect: sqlite3 */ SELECT id, value, html_id from urls
func (*Queries) UpdateHTMLByID ¶
UpdateHTMLByID
UPDATE htmls SET value = ? WHERE id = ? RETURNING id, value, updated_at, created_at
func (*Queries) UpdateSelectorByID ¶
func (q *Queries) UpdateSelectorByID(ctx context.Context, arg UpdateSelectorByIDParams) error
UpdateSelectorByID
UPDATE selectors SET value = ?, url_id = ?, context = ? WHERE id = ?
func (*Queries) UpdateURL ¶
func (q *Queries) UpdateURL(ctx context.Context, arg UpdateURLParams) error
UpdateURL
UPDATE urls SET value = ?, html_id = ? WHERE id = ?