infra

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package infra contains the types for schema 'accountdb'.

Package infra contains the types for schema 'accountdb'.

Package infra contains the types for schema 'accountdb'.

Package infra contains the types for schema 'accountdb'.

Package infra contains the types for schema 'accountdb'.

Index

Constants

View Source
const (
	// Exec operation for like sql.DB.Exec()
	Exec operation = 1
	// Query operation for sql.DB.Query()
	Query operation = 2
)

Variables

View Source
var XOLog = func(ctx context.Context, sqlstr string, params ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type Execer

type Execer interface {
	sqlx.Execer
	sqlx.ExecerContext
}

type Executor

type Executor interface {
	Queryer
	Execer
}

Executor is the common interface for database operations that can be used with types from schema 'accountdb'.

This should work with database/sql.DB and database/sql.Tx.

type GoogleAuth

type GoogleAuth struct {
	UserID    string    `db:"user_id"`    // user_id
	GoogleID  string    `db:"google_id"`  // google_id
	CreatedAt time.Time `db:"created_at"` // created_at
	UpdatedAt time.Time `db:"updated_at"` // updated_at
	// contains filtered or unexported fields
}

GoogleAuth represents a row from 'google_auth'.

func GetAllGoogleAuths

func GetAllGoogleAuths(ctx context.Context, db Queryer) ([]*GoogleAuth, error)

GetAllGoogleAuths gets all GoogleAuths

func GetGoogleAuth

func GetGoogleAuth(ctx context.Context, db Queryer, key string) (*GoogleAuth, error)

GetGoogleAuth gets a GoogleAuth by primary key

func GetGoogleAuths

func GetGoogleAuths(ctx context.Context, db Queryer, keys []string) ([]*GoogleAuth, error)

GetGoogleAuths gets GoogleAuth list by primary keys

func GoogleAuthByGoogleID

func GoogleAuthByGoogleID(ctx context.Context, db Queryer, googleID string) (*GoogleAuth, error)

GoogleAuthByGoogleID retrieves a row from 'google_auth' as a GoogleAuth. Generated from index 'google_id'.

func GoogleAuthByUserID

func GoogleAuthByUserID(ctx context.Context, db Queryer, userID string) (*GoogleAuth, error)

GoogleAuthByUserID retrieves a row from 'google_auth' as a GoogleAuth. Generated from index 'google_auth_user_id_pkey'.

func (*GoogleAuth) Delete

func (ga *GoogleAuth) Delete(ctx context.Context, db Execer) error

Delete deletes the GoogleAuth from the database.

func (*GoogleAuth) Deleted

func (ga *GoogleAuth) Deleted() bool

Deleted provides information if the GoogleAuth has been deleted from the database.

func (*GoogleAuth) Exists

func (ga *GoogleAuth) Exists() bool

Exists determines if the GoogleAuth exists in the database.

func (*GoogleAuth) Insert

func (ga *GoogleAuth) Insert(ctx context.Context, db Execer) error

Insert inserts the GoogleAuth to the database.

func (*GoogleAuth) InsertIfNotExist

func (ga *GoogleAuth) InsertIfNotExist(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the GoogleAuth to the database.

func (*GoogleAuth) InsertOrUpdate

func (ga *GoogleAuth) InsertOrUpdate(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the GoogleAuth to the database.

func (*GoogleAuth) Update

func (ga *GoogleAuth) Update(ctx context.Context, db Execer) error

Update updates the GoogleAuth in the database.

func (*GoogleAuth) User

func (ga *GoogleAuth) User(ctx context.Context, db Executor) (*User, error)

User returns the User associated with the GoogleAuth's UserID (user_id).

Generated from foreign key 'google_auth_ibfk_1'.

type PubsubEvent

type PubsubEvent struct {
	ID             string         `db:"id"`              // id
	DeduplicateKey sql.NullString `db:"deduplicate_key"` // deduplicate_key
	Topic          string         `db:"topic"`           // topic
	Data           string         `db:"data"`            // data
	IsPublished    bool           `db:"is_published"`    // is_published
	PublishedAt    mysql.NullTime `db:"published_at"`    // published_at
	CreatedAt      time.Time      `db:"created_at"`      // created_at
	// contains filtered or unexported fields
}

PubsubEvent represents a row from 'pubsub_events'.

func GetAllPubsubEvents

func GetAllPubsubEvents(ctx context.Context, db Queryer) ([]*PubsubEvent, error)

GetAllPubsubEvents gets all PubsubEvents

func GetPubsubEvent

func GetPubsubEvent(ctx context.Context, db Queryer, key string) (*PubsubEvent, error)

GetPubsubEvent gets a PubsubEvent by primary key

func GetPubsubEvents

func GetPubsubEvents(ctx context.Context, db Queryer, keys []string) ([]*PubsubEvent, error)

GetPubsubEvents gets PubsubEvent list by primary keys

func PubsubEventByID

func PubsubEventByID(ctx context.Context, db Queryer, id string) (*PubsubEvent, error)

PubsubEventByID retrieves a row from 'pubsub_events' as a PubsubEvent. Generated from index 'pubsub_events_id_pkey'.

func PubsubEventsByIsPublished

func PubsubEventsByIsPublished(ctx context.Context, db Queryer, isPublished bool) ([]*PubsubEvent, error)

PubsubEventsByIsPublished retrieves a row from 'pubsub_events' as a PubsubEvent. Generated from index 'is_published_idx'.

func (*PubsubEvent) Delete

func (pe *PubsubEvent) Delete(ctx context.Context, db Execer) error

Delete deletes the PubsubEvent from the database.

func (*PubsubEvent) Deleted

func (pe *PubsubEvent) Deleted() bool

Deleted provides information if the PubsubEvent has been deleted from the database.

func (*PubsubEvent) Exists

func (pe *PubsubEvent) Exists() bool

Exists determines if the PubsubEvent exists in the database.

func (*PubsubEvent) Insert

func (pe *PubsubEvent) Insert(ctx context.Context, db Execer) error

Insert inserts the PubsubEvent to the database.

func (*PubsubEvent) InsertIfNotExist

func (pe *PubsubEvent) InsertIfNotExist(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the PubsubEvent to the database.

func (*PubsubEvent) InsertOrUpdate

func (pe *PubsubEvent) InsertOrUpdate(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the PubsubEvent to the database.

func (*PubsubEvent) Update

func (pe *PubsubEvent) Update(ctx context.Context, db Execer) error

Update updates the PubsubEvent in the database.

type Queryer

type Queryer interface {
	sqlx.Queryer
	sqlx.QueryerContext
}

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type User

type User struct {
	ID        string    `db:"id"`         // id
	CreatedAt time.Time `db:"created_at"` // created_at
	UpdatedAt time.Time `db:"updated_at"` // updated_at
	// contains filtered or unexported fields
}

User represents a row from 'users'.

func GetAllUsers

func GetAllUsers(ctx context.Context, db Queryer) ([]*User, error)

GetAllUsers gets all Users

func GetUser

func GetUser(ctx context.Context, db Queryer, key string) (*User, error)

GetUser gets a User by primary key

func GetUsers

func GetUsers(ctx context.Context, db Queryer, keys []string) ([]*User, error)

GetUsers gets User list by primary keys

func UserByID

func UserByID(ctx context.Context, db Queryer, id string) (*User, error)

UserByID retrieves a row from 'users' as a User. Generated from index 'users_id_pkey'.

func (*User) Delete

func (u *User) Delete(ctx context.Context, db Execer) error

Delete deletes the User from the database.

func (*User) Deleted

func (u *User) Deleted() bool

Deleted provides information if the User has been deleted from the database.

func (*User) Exists

func (u *User) Exists() bool

Exists determines if the User exists in the database.

func (*User) Insert

func (u *User) Insert(ctx context.Context, db Execer) error

Insert inserts the User to the database.

func (*User) InsertIfNotExist

func (u *User) InsertIfNotExist(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the User to the database.

func (*User) InsertOrUpdate

func (u *User) InsertOrUpdate(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the User to the database.

func (*User) Update

func (u *User) Update(ctx context.Context, db Execer) error

Update updates the User in the database.

type UserProfile

type UserProfile struct {
	UserID       string         `db:"user_id"`        // user_id
	Email        string         `db:"email"`          // email
	DisplayName  string         `db:"display_name"`   // display_name
	ScreenImgURL sql.NullString `db:"screen_img_url"` // screen_img_url
	CreatedAt    time.Time      `db:"created_at"`     // created_at
	UpdatedAt    time.Time      `db:"updated_at"`     // updated_at
	// contains filtered or unexported fields
}

UserProfile represents a row from 'user_profiles'.

func GetAllUserProfiles

func GetAllUserProfiles(ctx context.Context, db Queryer) ([]*UserProfile, error)

GetAllUserProfiles gets all UserProfiles

func GetUserProfile

func GetUserProfile(ctx context.Context, db Queryer, key string) (*UserProfile, error)

GetUserProfile gets a UserProfile by primary key

func GetUserProfiles

func GetUserProfiles(ctx context.Context, db Queryer, keys []string) ([]*UserProfile, error)

GetUserProfiles gets UserProfile list by primary keys

func UserProfileByEmail

func UserProfileByEmail(ctx context.Context, db Queryer, email string) (*UserProfile, error)

UserProfileByEmail retrieves a row from 'user_profiles' as a UserProfile. Generated from index 'email'.

func UserProfileByUserID

func UserProfileByUserID(ctx context.Context, db Queryer, userID string) (*UserProfile, error)

UserProfileByUserID retrieves a row from 'user_profiles' as a UserProfile. Generated from index 'user_profiles_user_id_pkey'.

func (*UserProfile) Delete

func (up *UserProfile) Delete(ctx context.Context, db Execer) error

Delete deletes the UserProfile from the database.

func (*UserProfile) Deleted

func (up *UserProfile) Deleted() bool

Deleted provides information if the UserProfile has been deleted from the database.

func (*UserProfile) Exists

func (up *UserProfile) Exists() bool

Exists determines if the UserProfile exists in the database.

func (*UserProfile) Insert

func (up *UserProfile) Insert(ctx context.Context, db Execer) error

Insert inserts the UserProfile to the database.

func (*UserProfile) InsertIfNotExist

func (up *UserProfile) InsertIfNotExist(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the UserProfile to the database.

func (*UserProfile) InsertOrUpdate

func (up *UserProfile) InsertOrUpdate(ctx context.Context, db Executor) error

InsertOrUpdate inserts or updates the UserProfile to the database.

func (*UserProfile) Update

func (up *UserProfile) Update(ctx context.Context, db Execer) error

Update updates the UserProfile in the database.

func (*UserProfile) User

func (up *UserProfile) User(ctx context.Context, db Executor) (*User, error)

User returns the User associated with the UserProfile's UserID (user_id).

Generated from foreign key 'user_profiles_ibfk_1'.

Jump to

Keyboard shortcuts

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