Documentation ¶
Overview ¶
Package database provides low-level database connections and querier adapters for the application
Index ¶
- Constants
- func IsSchemaUpToDate(db *sql.DB) error
- func Migrate(driverName string, db *sql.DB) error
- func NewConn(driver, dsn string) (*sql.DB, error)
- func NewSQLiteConn(dbFile string) (*sql.DB, error)
- type AddWishToWishlistParams
- type ApiKey
- type CreateAPIKeyParams
- type CreateGiftExchangeParams
- type CreateProfileParams
- type CreateSessionInitParams
- type CreateWishParams
- type CreateWishlistParams
- type DBTX
- type GetWishlistRow
- type GiftExchange
- type GiftExchangesProfile
- type InsertWishToWishlistParams
- type ListProfileWishlistsRow
- type ListProfileWishlistsWithVisibilityParams
- type ListProfileWishlistsWithVisibilityRow
- type Profile
- type Queries
- func (q *Queries) AddWishToWishlist(ctx context.Context, arg AddWishToWishlistParams) error
- func (q *Queries) CountProfiles(ctx context.Context) (int64, error)
- func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
- func (q *Queries) CreateGiftExchange(ctx context.Context, arg CreateGiftExchangeParams) (GiftExchange, error)
- func (q *Queries) CreateProfile(ctx context.Context, arg CreateProfileParams) (Profile, error)
- func (q *Queries) CreateSession(ctx context.Context, profileID string) (Session, error)
- func (q *Queries) CreateSessionInit(ctx context.Context, arg CreateSessionInitParams) (SessionsInit, error)
- func (q *Queries) CreateWish(ctx context.Context, arg CreateWishParams) (Wish, error)
- func (q *Queries) CreateWishlist(ctx context.Context, arg CreateWishlistParams) (Wishlist, error)
- func (q *Queries) DeleteAPIKey(ctx context.Context, id string) error
- func (q *Queries) DeleteAllSessions(ctx context.Context, profileID string) error
- func (q *Queries) DeleteExpiredSessionInit(ctx context.Context) error
- func (q *Queries) DeleteGiftExchange(ctx context.Context, id string) error
- func (q *Queries) DeleteProfile(ctx context.Context, id string) error
- func (q *Queries) DeleteSession(ctx context.Context, id string) error
- func (q *Queries) DeleteSessionInit(ctx context.Context, id string) error
- func (q *Queries) DeleteWish(ctx context.Context, id string) error
- func (q *Queries) DeleteWishlist(ctx context.Context, id string) error
- func (q *Queries) GetExchange(ctx context.Context, id string) (GiftExchange, error)
- func (q *Queries) GetProfile(ctx context.Context, id string) (Profile, error)
- func (q *Queries) GetProfileByEmail(ctx context.Context, email string) (Profile, error)
- func (q *Queries) GetSession(ctx context.Context, id string) (Session, error)
- func (q *Queries) GetSessionInit(ctx context.Context, id string) (SessionsInit, error)
- func (q *Queries) GetWish(ctx context.Context, id string) (Wish, error)
- func (q *Queries) GetWishlist(ctx context.Context, id string) (GetWishlistRow, error)
- func (q *Queries) InsertWishToWishlist(ctx context.Context, arg InsertWishToWishlistParams) error
- func (q *Queries) ListAPIKeys(ctx context.Context, profileID string) ([]ApiKey, error)
- func (q *Queries) ListGiftExchangeMembers(ctx context.Context, giftExchangesID string) ([]GiftExchangesProfile, error)
- func (q *Queries) ListGiftExchanges(ctx context.Context) ([]GiftExchange, error)
- func (q *Queries) ListProfileWishlists(ctx context.Context, profileID string) ([]ListProfileWishlistsRow, error)
- func (q *Queries) ListProfileWishlistsWithVisibility(ctx context.Context, arg ListProfileWishlistsWithVisibilityParams) ([]ListProfileWishlistsWithVisibilityRow, error)
- func (q *Queries) ListProfiles(ctx context.Context) ([]Profile, error)
- func (q *Queries) ListUnlistedWishes(ctx context.Context, profileID string) ([]Wish, error)
- func (q *Queries) RemoveWishFromWishlist(ctx context.Context, arg RemoveWishFromWishlistParams) error
- func (q *Queries) ShiftWishlistAfterPosition(ctx context.Context, arg ShiftWishlistAfterPositionParams) error
- func (q *Queries) UpdateGiftExchange(ctx context.Context, arg UpdateGiftExchangeParams) (GiftExchange, error)
- func (q *Queries) UpdateProfile(ctx context.Context, arg UpdateProfileParams) (Profile, error)
- func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionParams) (Session, error)
- func (q *Queries) UpdateWish(ctx context.Context, arg UpdateWishParams) (Wish, error)
- func (q *Queries) UpdateWishlist(ctx context.Context, arg UpdateWishlistParams) (Wishlist, error)
- func (q *Queries) WishesByWishlist(ctx context.Context, listID string) ([]WishesByWishlistRow, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type RemoveWishFromWishlistParams
- type Session
- type SessionsInit
- type ShiftWishlistAfterPositionParams
- type UpdateGiftExchangeParams
- type UpdateProfileParams
- type UpdateSessionParams
- type UpdateWishParams
- type UpdateWishlistParams
- type Wish
- type WishesByWishlistRow
- type Wishlist
- type WishlistsWish
Constants ¶
View Source
const ( // DriverSqlite identifier indicates the sqlite3 driver DriverSqlite string = "sqlite3" )
Variables ¶
This section is empty.
Functions ¶
func IsSchemaUpToDate ¶
IsSchemaUpToDate will check that the database is up to date with the expected database schema version
Types ¶
type AddWishToWishlistParams ¶
type CreateAPIKeyParams ¶
type CreateProfileParams ¶
type CreateSessionInitParams ¶
type CreateWishParams ¶
type CreateWishlistParams ¶
type GetWishlistRow ¶
type GiftExchange ¶
type GiftExchangesProfile ¶
type ListProfileWishlistsRow ¶
type ListProfileWishlistsWithVisibilityRow ¶
type ListProfileWishlistsWithVisibilityRow struct { ID string `db:"id"` ProfileID string `db:"profile_id"` Title string `db:"title"` Description string `db:"description"` Created time.Time `db:"created"` Updated time.Time `db:"updated"` Visibility string `db:"visibility"` WishesCount int64 `db:"wishes_count"` }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddWishToWishlist ¶
func (q *Queries) AddWishToWishlist(ctx context.Context, arg AddWishToWishlistParams) error
func (*Queries) CreateAPIKey ¶
func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
func (*Queries) CreateGiftExchange ¶
func (q *Queries) CreateGiftExchange(ctx context.Context, arg CreateGiftExchangeParams) (GiftExchange, error)
func (*Queries) CreateProfile ¶
func (*Queries) CreateSession ¶
func (*Queries) CreateSessionInit ¶
func (q *Queries) CreateSessionInit(ctx context.Context, arg CreateSessionInitParams) (SessionsInit, error)
func (*Queries) CreateWish ¶
func (*Queries) CreateWishlist ¶
func (*Queries) DeleteAllSessions ¶
func (*Queries) DeleteExpiredSessionInit ¶
func (*Queries) DeleteGiftExchange ¶
func (*Queries) DeleteProfile ¶
func (*Queries) DeleteSession ¶
func (*Queries) DeleteSessionInit ¶
func (*Queries) DeleteWishlist ¶
func (*Queries) GetExchange ¶
func (*Queries) GetProfile ¶
func (*Queries) GetProfileByEmail ¶
func (*Queries) GetSession ¶
func (*Queries) GetSessionInit ¶
func (*Queries) GetWishlist ¶
func (*Queries) InsertWishToWishlist ¶
func (q *Queries) InsertWishToWishlist(ctx context.Context, arg InsertWishToWishlistParams) error
func (*Queries) ListAPIKeys ¶
func (*Queries) ListGiftExchangeMembers ¶
func (*Queries) ListGiftExchanges ¶
func (q *Queries) ListGiftExchanges(ctx context.Context) ([]GiftExchange, error)
func (*Queries) ListProfileWishlists ¶
func (*Queries) ListProfileWishlistsWithVisibility ¶
func (q *Queries) ListProfileWishlistsWithVisibility(ctx context.Context, arg ListProfileWishlistsWithVisibilityParams) ([]ListProfileWishlistsWithVisibilityRow, error)
func (*Queries) ListProfiles ¶
func (*Queries) ListUnlistedWishes ¶
func (*Queries) RemoveWishFromWishlist ¶
func (q *Queries) RemoveWishFromWishlist(ctx context.Context, arg RemoveWishFromWishlistParams) error
func (*Queries) ShiftWishlistAfterPosition ¶
func (q *Queries) ShiftWishlistAfterPosition(ctx context.Context, arg ShiftWishlistAfterPositionParams) error
func (*Queries) UpdateGiftExchange ¶
func (q *Queries) UpdateGiftExchange(ctx context.Context, arg UpdateGiftExchangeParams) (GiftExchange, error)
func (*Queries) UpdateProfile ¶
func (*Queries) UpdateSession ¶
func (*Queries) UpdateWish ¶
func (*Queries) UpdateWishlist ¶
func (*Queries) WishesByWishlist ¶
type SessionsInit ¶
type UpdateProfileParams ¶
type UpdateSessionParams ¶
type UpdateWishParams ¶
type UpdateWishlistParams ¶
type WishesByWishlistRow ¶
type WishesByWishlistRow struct { ID string `db:"id"` ProfileID string `db:"profile_id"` Url string `db:"url"` Title string `db:"title"` Description string `db:"description"` Quantity int64 `db:"quantity"` Created time.Time `db:"created"` ListID string `db:"list_id"` Ordinal int64 `db:"ordinal"` AddedDate time.Time `db:"added_date"` }
Click to show internal directories.
Click to hide internal directories.