persist

package
v0.0.0-...-c455053 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PlaceSettingsID = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresPersister

type PostgresPersister struct {
	// contains filtered or unexported fields
}

PostgresPersister persists the model objects to Postgresql

func NewPostgresPersister

func NewPostgresPersister(db *sql.DB) PostgresPersister

NewPostgresPersister constructs a new PostgresPersister

func (PostgresPersister) DeleteCategory

func (p PostgresPersister) DeleteCategory(ctx context.Context, id uint32) error

DeleteCategory deletes a Category

func (PostgresPersister) DeleteCollection

func (p PostgresPersister) DeleteCollection(ctx context.Context, id uint32) error

DeleteCollection deletes a Collection

func (PostgresPersister) DeleteInvitation

func (p PostgresPersister) DeleteInvitation(ctx context.Context, id uint32) error

DeleteInvitation deletes a Invitation

func (PostgresPersister) DeletePost

func (p PostgresPersister) DeletePost(ctx context.Context, id uint32) error

DeletePost deletes a Post

func (PostgresPersister) DeleteRecord

func (p PostgresPersister) DeleteRecord(ctx context.Context, id uint32) error

DeleteRecord deletes a Record

func (PostgresPersister) DeleteRecordHouseholdsForPost

func (p PostgresPersister) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error

DeleteRecordHouseholdsForPost deletes all Record Households for a post

func (PostgresPersister) DeleteRecordsForPost

func (p PostgresPersister) DeleteRecordsForPost(ctx context.Context, postID uint32) error

DeleteRecordsForPost deletes all Records for a post

func (PostgresPersister) DeleteSociety

func (p PostgresPersister) DeleteSociety(ctx context.Context) error

DeleteSociety deletes a society

func (PostgresPersister) DeleteSocietyUser

func (p PostgresPersister) DeleteSocietyUser(ctx context.Context, id uint32) error

DeleteSocietyUser deletes a SocietyUser

func (PostgresPersister) InsertCategory

func (p PostgresPersister) InsertCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)

InsertCategory inserts a CategoryBody into the database and returns the inserted Category

func (PostgresPersister) InsertCollection

func (p PostgresPersister) InsertCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)

InsertCollection inserts a CollectionBody into the database and returns the inserted Collection

func (PostgresPersister) InsertInvitation

func (p PostgresPersister) InsertInvitation(ctx context.Context, in model.InvitationIn) (*model.Invitation, error)

InsertInvitation inserts a InvitationBody into the database and returns the inserted Invitation

func (PostgresPersister) InsertPost

func (p PostgresPersister) InsertPost(ctx context.Context, in model.PostIn) (*model.Post, error)

InsertPost inserts a PostBody into the database and returns the inserted Post

func (PostgresPersister) InsertRecord

func (p PostgresPersister) InsertRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)

InsertRecord inserts a RecordBody into the database and returns the inserted Record

func (PostgresPersister) InsertRecordHousehold

func (p PostgresPersister) InsertRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)

InsertRecordHousehold inserts a RecordHouseholdIn into the database and returns the inserted RecordHousehold

func (PostgresPersister) InsertSociety

func (p PostgresPersister) InsertSociety(ctx context.Context, in model.SocietyIn) (*model.Society, error)

InsertSociety inserts a SocietyBody into the database and returns the inserted Society

func (PostgresPersister) InsertSocietyUser

func (p PostgresPersister) InsertSocietyUser(ctx context.Context, in model.SocietyUserIn) (*model.SocietyUser, error)

InsertSocietyUser inserts a SocietyUserBody into the database and returns the inserted SocietyUser

func (PostgresPersister) RetrieveUser

func (p PostgresPersister) RetrieveUser(ctx context.Context, in model.UserIn) (*model.User, bool, error)

RetrieveUser either retrieves a user record from the database, or creates the record if it doesn't already exist. Returns the new user and true if it was added

func (PostgresPersister) SelectAllSocietyUsersByUser

func (p PostgresPersister) SelectAllSocietyUsersByUser(ctx context.Context, userID uint32) ([]model.SocietyUser, error)

func (PostgresPersister) SelectCategories

func (p PostgresPersister) SelectCategories(ctx context.Context) ([]model.Category, error)

SelectCategories loads all the categories from the database

func (PostgresPersister) SelectCategoriesByID

func (p PostgresPersister) SelectCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)

SelectCategoriesByID selects many categories

func (PostgresPersister) SelectCollections

func (p PostgresPersister) SelectCollections(ctx context.Context) ([]model.Collection, error)

SelectCollections selects all collections

func (PostgresPersister) SelectCollectionsByID

func (p PostgresPersister) SelectCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)

SelectCollectionsByID selects many collections

func (PostgresPersister) SelectInvitationByCode

func (p PostgresPersister) SelectInvitationByCode(ctx context.Context, code string) (*model.Invitation, error)

SelectInvitationsByUser selects Invitation for code

func (PostgresPersister) SelectInvitations

func (p PostgresPersister) SelectInvitations(ctx context.Context) ([]model.Invitation, error)

SelectAllInvitations selects all Invitations for society

func (PostgresPersister) SelectNameVariants

func (p PostgresPersister) SelectNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)

SelectNameVariants selects the NameVariants object if it exists or returns ErrNoRows

func (PostgresPersister) SelectOneCategory

func (p PostgresPersister) SelectOneCategory(ctx context.Context, id uint32) (*model.Category, error)

SelectOneCategory loads a single category from the database

func (PostgresPersister) SelectOneCollection

func (p PostgresPersister) SelectOneCollection(ctx context.Context, id uint32) (*model.Collection, error)

SelectOneCollection selects a single collection

func (PostgresPersister) SelectOneInvitation

func (p PostgresPersister) SelectOneInvitation(ctx context.Context, id uint32) (*model.Invitation, error)

SelectOneInvitation loads a single Invitation from the database

func (PostgresPersister) SelectOnePost

func (p PostgresPersister) SelectOnePost(ctx context.Context, id uint32) (*model.Post, error)

SelectOnePost selects a single post

func (PostgresPersister) SelectOneRecord

func (p PostgresPersister) SelectOneRecord(ctx context.Context, id uint32) (*model.Record, error)

SelectOneRecord selects a single record

func (PostgresPersister) SelectOneRecordHousehold

func (p PostgresPersister) SelectOneRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)

SelectOneRecordHousehold selects a single record household

func (PostgresPersister) SelectOneSocietyUser

func (p PostgresPersister) SelectOneSocietyUser(ctx context.Context, id uint32) (*model.SocietyUser, error)

SelectOneSocietyUser loads a single SocietyUser from the database

func (PostgresPersister) SelectOneSocietyUserByUser

func (p PostgresPersister) SelectOneSocietyUserByUser(ctx context.Context, userID uint32) (*model.SocietyUser, error)

func (PostgresPersister) SelectPlace

func (p PostgresPersister) SelectPlace(ctx context.Context, id uint32) (*model.Place, error)

SelectPlace selects the Place object if it exists or returns ErrNoRows

func (PostgresPersister) SelectPlaceSettings

func (p PostgresPersister) SelectPlaceSettings(ctx context.Context) (*model.PlaceSettings, error)

SelectPlaceSettings selects the PlaceSettings object if it exists or returns ErrNoRows

func (PostgresPersister) SelectPlaceWord

func (p PostgresPersister) SelectPlaceWord(ctx context.Context, word string) (*model.PlaceWord, error)

SelectPlaceWord selects the PlaceWord object if it exists or returns ErrNoRows

func (PostgresPersister) SelectPlaceWordsByWord

func (p PostgresPersister) SelectPlaceWordsByWord(ctx context.Context, words []string) ([]model.PlaceWord, error)

SelectPlaceWordsByWord selects multiple PlaceWord objects by word

func (PostgresPersister) SelectPlacesByFullNamePrefix

func (p PostgresPersister) SelectPlacesByFullNamePrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)

SelectPlacesByFullNamePrefix selects multiple Place objects by a prefix

func (PostgresPersister) SelectPlacesByID

func (p PostgresPersister) SelectPlacesByID(ctx context.Context, ids []uint32) ([]model.Place, error)

SelectPlacesByID selects multiple Place objects by ID

func (PostgresPersister) SelectPosts

func (p PostgresPersister) SelectPosts(ctx context.Context) ([]model.Post, error)

SelectPosts selects all posts

func (PostgresPersister) SelectRecordHouseholdsForPost

func (p PostgresPersister) SelectRecordHouseholdsForPost(ctx context.Context, postID uint32) ([]model.RecordHousehold, error)

SelectRecordsForPost selects all records households for a post

func (PostgresPersister) SelectRecordsByID

func (p PostgresPersister) SelectRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)

SelectRecordsByID selects many records

func (PostgresPersister) SelectRecordsForPost

func (p PostgresPersister) SelectRecordsForPost(ctx context.Context, postID uint32, limit int) ([]model.Record, error)

SelectRecordsForPost selects limit records for a post

func (PostgresPersister) SelectSociety

func (p PostgresPersister) SelectSociety(ctx context.Context, id uint32) (*model.Society, error)

SelectOneSociety loads the current Society from the database

func (PostgresPersister) SelectSocietySummariesByID

func (p PostgresPersister) SelectSocietySummariesByID(ctx context.Context, ids []uint32) ([]model.SocietySummary, error)

SelectSocietySummariesByID selects multiple society summaries

func (PostgresPersister) SelectSocietySummary

func (p PostgresPersister) SelectSocietySummary(ctx context.Context, id uint32) (*model.SocietySummary, error)

SelectOneSociety loads a SocietySummary from the database

func (PostgresPersister) SelectSocietyUsers

func (p PostgresPersister) SelectSocietyUsers(ctx context.Context) ([]model.SocietyUser, error)

SelectSocietyUsers selects all SocietyUsers for current society

func (PostgresPersister) SelectUsersByID

func (p PostgresPersister) SelectUsersByID(ctx context.Context, ids []uint32) ([]model.User, error)

func (PostgresPersister) UpdateCategory

func (p PostgresPersister) UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)

UpdateCategory updates a Category in the database and returns the updated Category

func (PostgresPersister) UpdateCollection

func (p PostgresPersister) UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)

UpdateCollection updates a Collection in the database and returns the updated Collection

func (PostgresPersister) UpdatePost

func (p PostgresPersister) UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)

UpdatePost updates a Post in the database and returns the updated Post

func (PostgresPersister) UpdateRecord

func (p PostgresPersister) UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)

UpdateRecord updates a Record in the database and returns the updated Record

func (PostgresPersister) UpdateSociety

func (p PostgresPersister) UpdateSociety(ctx context.Context, in model.Society) (*model.Society, error)

UpdateSociety updates a Society in the database and returns the updated Society

func (PostgresPersister) UpdateSocietyUser

func (p PostgresPersister) UpdateSocietyUser(ctx context.Context, id uint32, in model.SocietyUser) (*model.SocietyUser, error)

UpdateSocietyUser updates a SocietyUser in the database and returns the updated SocietyUser can't update societyID or userID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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