queries

package
v0.0.0-...-df8baf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package queries provides access to all the database queries for all models

Package queries provides access to all the database queries for all models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogQueries

type BlogQueries struct {
	*sqlx.DB
}

BlogQueries is a type to collate all queries associated with BlogPosts

func (*BlogQueries) CreateBlogPost

func (q *BlogQueries) CreateBlogPost(b *models.FullBlogPost) error

CreateBlogPost creates a new blog post with the provided FullBlogPost

func (*BlogQueries) DeleteBlogPost

func (q *BlogQueries) DeleteBlogPost(id uuid.UUID) error

DeleteBlogPost deletes a blog post with the given ID

func (*BlogQueries) GetBlogPost

func (q *BlogQueries) GetBlogPost(id uuid.UUID) (models.BlogPost, error)

GetBlogPost gets the blog post with the provided ID

func (*BlogQueries) GetBlogPosts

func (q *BlogQueries) GetBlogPosts() ([]models.BlogPost, error)

GetBlogPosts gets all blog posts

func (*BlogQueries) GetFullBlogPost

func (q *BlogQueries) GetFullBlogPost(id uuid.UUID) (models.FullBlogPost, error)

GetFullBlogPost gets the blog post with the provided ID (with source)

func (*BlogQueries) GetFullBlogPosts

func (q *BlogQueries) GetFullBlogPosts() ([]models.FullBlogPost, error)

GetFullBlogPosts gets all blog posts (with source)

func (*BlogQueries) UpdateBlogPost

func (q *BlogQueries) UpdateBlogPost(b *models.FullBlogPost) error

UpdateBlogPost updates a blog post with the information in the provided FullBlogPost

type ImageQueries

type ImageQueries struct {
	*sqlx.DB
}

ImageQueries is a type to collate all queries associated with Images

func (*ImageQueries) AddImage

func (q *ImageQueries) AddImage(img *models.Image) error

AddImage adds an image

func (*ImageQueries) DeleteImage

func (q *ImageQueries) DeleteImage(id uuid.UUID) error

DeleteImage will delete an image with the provided ID

func (*ImageQueries) GetImage

func (q *ImageQueries) GetImage(id uuid.UUID) (models.Image, error)

GetImage will get the image with the given ID

func (*ImageQueries) GetImages

func (q *ImageQueries) GetImages() ([]models.Image, error)

GetImages will get all images available

func (*ImageQueries) UpdateImage

func (q *ImageQueries) UpdateImage(img *models.Image) error

UpdateImage will update an image to have the provided information in Image

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL