gen

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreProfilesFriends

func AreProfilesFriends(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID1 int,
	profileID2 int,
) (bool, error)

func AttachGalleryImageToProfile

func AttachGalleryImageToProfile(
	ctx context.Context,
	db Execer,
	dialect string,
	imageID int,
	profileID int,
) error

func ClearProfileImageByImageID

func ClearProfileImageByImageID(
	ctx context.Context,
	db Execer,
	dialect string,
	imageID int,
) error

func CountSubscriptionBenefactorsBySubscriptionID

func CountSubscriptionBenefactorsBySubscriptionID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	subscriptionID int,
) (int, error)

func CountUnseenNotificationsByProfile

func CountUnseenNotificationsByProfile(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID int,
) (int, error)

func DeleteImageByID

func DeleteImageByID(
	ctx context.Context,
	db Execer,
	dialect string,
	imageID int,
) error

func DeletePasswordTokensByUserID

func DeletePasswordTokensByUserID(
	ctx context.Context,
	db Execer,
	dialect string,
	userID int,
) error

func DeleteSubscriptionByID

func DeleteSubscriptionByID(
	ctx context.Context,
	db Execer,
	dialect string,
	subscriptionID int,
) error

func DeleteUserByProfileID

func DeleteUserByProfileID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
) error

func GetPasswordTokenHash

func GetPasswordTokenHash(
	ctx context.Context,
	db QueryRower,
	dialect string,
	userID int,
	tokenID int,
	notBefore time.Time,
) (string, error)

func GetProfileFullyOnboardedByUserID

func GetProfileFullyOnboardedByUserID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	userID int,
) (bool, error)

func GetProfileImageIDByProfileID

func GetProfileImageIDByProfileID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID int,
) (sql.NullInt64, error)

func GetProfileThumbnailObjectKeyByUserID

func GetProfileThumbnailObjectKeyByUserID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	userID int,
) (string, error)

func GetUserDisplayNameByUserID

func GetUserDisplayNameByUserID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	userID int,
) (string, error)

func ImageBelongsToProfileGallery

func ImageBelongsToProfileGallery(
	ctx context.Context,
	db QueryRower,
	dialect string,
	imageID int,
	profileID int,
) (bool, error)

func InsertImage

func InsertImage(
	ctx context.Context,
	db QueryExecRower,
	dialect string,
	imageType string,
	createdAt time.Time,
	updatedAt time.Time,
) (int, error)

func InsertImageSize

func InsertImageSize(
	ctx context.Context,
	db Execer,
	dialect string,
	size string,
	width int,
	height int,
	imageID int,
	fileID int,
	createdAt time.Time,
	updatedAt time.Time,
) error

func InsertLastSeenOnline

func InsertLastSeenOnline(
	ctx context.Context,
	db Execer,
	dialect string,
	userID int,
	seenAt time.Time,
) error

func InsertPasswordToken

func InsertPasswordToken(
	ctx context.Context,
	db QueryExecRower,
	dialect string,
	userID int,
	hash string,
	createdAt time.Time,
) (int, error)

func InsertProfile

func InsertProfile(
	ctx context.Context,
	db QueryExecRower,
	dialect string,
	userID int,
	bio string,
	birthdate time.Time,
	age int,
	countryCode *string,
	phoneE164 *string,
	createdAt time.Time,
	updatedAt time.Time,
) (int, error)

func LinkProfilesAsFriends

func LinkProfilesAsFriends(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	friendID int,
) error

func MarkProfileFullyOnboardedByID

func MarkProfileFullyOnboardedByID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
) error

func MarkProfilePhoneVerifiedByID

func MarkProfilePhoneVerifiedByID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
) error

func MarkUserVerifiedByUserID

func MarkUserVerifiedByUserID(
	ctx context.Context,
	db Execer,
	dialect string,
	userID int,
) error

func RemoveSubscriptionBenefactorBySubscriptionAndProfile

func RemoveSubscriptionBenefactorBySubscriptionAndProfile(
	ctx context.Context,
	db Execer,
	dialect string,
	subscriptionID int,
	profileID int,
) error

func SetProfileImageID

func SetProfileImageID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	imageID int,
) error

func UnlinkProfilesAsFriends

func UnlinkProfilesAsFriends(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	friendID int,
) error

func UpdateProfileBioByID

func UpdateProfileBioByID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	bio string,
) error

func UpdateProfileDetailsByID

func UpdateProfileDetailsByID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	bio string,
	birthdate time.Time,
	age int,
	countryCode *string,
	phoneE164 *string,
) error

func UpdateProfilePhoneByID

func UpdateProfilePhoneByID(
	ctx context.Context,
	db Execer,
	dialect string,
	profileID int,
	countryCode string,
	phoneE164 string,
) error

func UpdateUserDisplayNameByUserID

func UpdateUserDisplayNameByUserID(
	ctx context.Context,
	db Execer,
	dialect string,
	userID int,
	displayName string,
) error

func UpdateUserPasswordHashByUserID

func UpdateUserPasswordHashByUserID(
	ctx context.Context,
	db Execer,
	dialect string,
	userID int,
	passwordHash string,
) error

Types

type AuthIdentity

type AuthIdentity struct {
	UserID                int
	UserName              string
	UserEmail             string
	HasProfile            bool
	ProfileID             int
	ProfileFullyOnboarded bool
}

func GetAuthIdentityByUserID

func GetAuthIdentityByUserID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	userID int,
) (*AuthIdentity, error)

type AuthUserRecord

type AuthUserRecord struct {
	UserID     int
	Name       string
	Email      string
	Password   string
	IsVerified bool
}

func GetAuthUserRecordByEmail

func GetAuthUserRecordByEmail(
	ctx context.Context,
	db QueryRower,
	dialect string,
	email string,
) (*AuthUserRecord, error)

type Execer

type Execer interface {
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

Execer is the minimal exec contract used by generated write helpers.

type ProfileCoreRecord

type ProfileCoreRecord struct {
	ProfileID       int
	Name            string
	Age             sql.NullInt64
	Bio             sql.NullString
	PhoneNumberE164 sql.NullString
	CountryCode     sql.NullString
}

func GetProfileCoreByID

func GetProfileCoreByID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID int,
) (*ProfileCoreRecord, error)

type ProfileFriendRecord

type ProfileFriendRecord struct {
	ProfileID       int
	UserID          int
	Name            string
	Age             sql.NullInt64
	Bio             sql.NullString
	PhoneNumberE164 sql.NullString
	CountryCode     sql.NullString
}

func GetFriendsByProfileID

func GetFriendsByProfileID(
	ctx context.Context,
	db Queryer,
	dialect string,
	profileID int,
) ([]ProfileFriendRecord, error)

type ProfilePhotoSizeRecord

type ProfilePhotoSizeRecord struct {
	ImageID   int
	Size      string
	Width     int
	Height    int
	ObjectKey string
}

func GetImageStorageObjectsByImageID

func GetImageStorageObjectsByImageID(
	ctx context.Context,
	db Queryer,
	dialect string,
	imageID int,
) ([]ProfilePhotoSizeRecord, error)

func GetProfileImageByProfileID

func GetProfileImageByProfileID(
	ctx context.Context,
	db Queryer,
	dialect string,
	profileID int,
) ([]ProfilePhotoSizeRecord, error)

func GetProfilePhotosByProfileID

func GetProfilePhotosByProfileID(
	ctx context.Context,
	db Queryer,
	dialect string,
	profileID int,
) ([]ProfilePhotoSizeRecord, error)

type ProfileSettingsRecord

type ProfileSettingsRecord struct {
	ID              int
	Bio             string
	Birthdate       sql.NullTime
	CountryCode     sql.NullString
	PhoneNumberE164 sql.NullString
	PhoneVerified   bool
	FullyOnboarded  bool
}

func GetProfileSettingsByID

func GetProfileSettingsByID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID int,
) (*ProfileSettingsRecord, error)

type QueryExecRower

type QueryExecRower interface {
	QueryRower
	Execer
}

QueryExecRower is the minimal combined contract for read/write helpers that need both QueryRowContext and ExecContext support.

type QueryRower

type QueryRower interface {
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}

QueryRower is the minimal query contract used by generated read helpers.

type Queryer

type Queryer interface {
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}

type SubscriptionBenefactorRecord

type SubscriptionBenefactorRecord struct {
	SubscriptionID int
	PayingProfile  int
}

func GetSubscriptionForBenefactorByProfileID

func GetSubscriptionForBenefactorByProfileID(
	ctx context.Context,
	db QueryRower,
	dialect string,
	profileID int,
) (*SubscriptionBenefactorRecord, error)

Jump to

Keyboard shortcuts

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