// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.28.0 // source: sites.sql package dbq import ( "context" ) const getSiteWithID = `-- name: GetSiteWithID :one SELECT id, owner_user_id, name, title, theme, props FROM sites WHERE id = $1 LIMIT 1 ` func (q *Queries) GetSiteWithID(ctx context.Context, id int64) (Site, error) { row := q.db.QueryRow(ctx, getSiteWithID, id) var i Site err := row.Scan( &i.ID, &i.OwnerUserID, &i.Name, &i.Title, &i.Theme, &i.Props, ) return i, err } const listSites = `-- name: ListSites :one SELECT id, owner_user_id, name, title, theme, props FROM sites ` func (q *Queries) ListSites(ctx context.Context) (Site, error) { row := q.db.QueryRow(ctx, listSites) var i Site err := row.Scan( &i.ID, &i.OwnerUserID, &i.Name, &i.Title, &i.Theme, &i.Props, ) return i, err } const newSite = `-- name: NewSite :one INSERT INTO sites ( name, owner_user_id, title, theme, props ) VALUES ($1, $2, $3, $4, $5) RETURNING id ` type NewSiteParams struct { Name string OwnerUserID int64 Title string Theme string Props []byte } func (q *Queries) NewSite(ctx context.Context, arg NewSiteParams) (int64, error) { row := q.db.QueryRow(ctx, newSite, arg.Name, arg.OwnerUserID, arg.Title, arg.Theme, arg.Props, ) var id int64 err := row.Scan(&id) return id, err } const updateSite = `-- name: UpdateSite :exec UPDATE sites SET name = $2, title = $3, theme = $4 WHERE id = $1 ` type UpdateSiteParams struct { ID int64 Name string Title string Theme string } func (q *Queries) UpdateSite(ctx context.Context, arg UpdateSiteParams) error { _, err := q.db.Exec(ctx, updateSite, arg.ID, arg.Name, arg.Title, arg.Theme, ) return err }