Versions in this module Expand all Collapse all v1 v1.0.0 Aug 14, 2024 Changes in this version + type Character struct + Date time.Time + ID int64 + Image string + Name string + Type string + UserID uint64 + type DBTX interface + ExecContext func(context.Context, string, ...interface{}) (sql.Result, error) + PrepareContext func(context.Context, string) (*sql.Stmt, error) + QueryContext func(context.Context, string, ...interface{}) (*sql.Rows, error) + QueryRowContext func(context.Context, string, ...interface{}) *sql.Row + type Queries struct + func New(db DBTX) *Queries + func NewDB(connstr string) (*Queries, error) + func Prepare(ctx context.Context, db DBTX) (*Queries, error) + func (q *Queries) AddDropToken(ctx context.Context, userID corde.Snowflake) error + func (q *Queries) Chars(ctx context.Context, userID corde.Snowflake) ([]discord.Character, error) + func (q *Queries) CharsIDs(ctx context.Context, userID corde.Snowflake) ([]int64, error) + func (q *Queries) CharsStartingWith(ctx context.Context, userID corde.Snowflake, s string) ([]discord.Character, error) + func (q *Queries) Close() error + func (q *Queries) ConsumeDropTokens(ctx context.Context, userID corde.Snowflake, count int32) (discord.User, error) + func (q *Queries) DeleteChar(ctx context.Context, userID corde.Snowflake, charID int64) (discord.Character, error) + func (q *Queries) GiveUserChar(ctx context.Context, dst corde.Snowflake, src corde.Snowflake, charID int64) error + func (q *Queries) Profile(ctx context.Context, userID corde.Snowflake) (discord.Profile, error) + func (q *Queries) PutChar(ctx context.Context, userID corde.Snowflake, c discord.Character) error + func (q *Queries) SetChar(ctx context.Context, arg SetCharParams) (Character, error) + func (q *Queries) SetUserAnilistURL(ctx context.Context, userID corde.Snowflake, url string) error + func (q *Queries) SetUserDate(ctx context.Context, userID corde.Snowflake, d time.Time) error + func (q *Queries) SetUserFavorite(ctx context.Context, userID corde.Snowflake, c int64) error + func (q *Queries) SetUserQuote(ctx context.Context, userID corde.Snowflake, quote string) error + func (q *Queries) SetUserToken(ctx context.Context, userID corde.Snowflake, token string) error + func (q *Queries) Tx(fn func(s discord.Store) error) error + func (q *Queries) User(ctx context.Context, userID corde.Snowflake) (discord.User, error) + func (q *Queries) VerifyChar(ctx context.Context, userID corde.Snowflake, charID int64) (discord.Character, error) + func (q *Queries) WithTx(tx *sql.Tx) *Queries + type SetCharParams struct + ID int64 + Image string + Name string + type User struct + AnilistUrl string + Date time.Time + Favorite sql.NullInt64 + ID int32 + Quote string + Tokens int32 + UserID uint64