sqlc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                string         `json:"id"`
	UserID            string         `json:"user_id"`
	Provider          string         `json:"provider"`
	ProviderAccountID sql.NullString `json:"provider_account_id"`
	PasswordHash      sql.NullString `json:"password_hash"`
	AccessToken       sql.NullString `json:"access_token"`
	RefreshToken      sql.NullString `json:"refresh_token"`
	ExpiresAt         sql.NullString `json:"expires_at"`
	CreatedAt         string         `json:"created_at"`
	UpdatedAt         string         `json:"updated_at"`
}

type CreateAccountParams

type CreateAccountParams struct {
	ID                string         `json:"id"`
	UserID            string         `json:"user_id"`
	Provider          string         `json:"provider"`
	ProviderAccountID sql.NullString `json:"provider_account_id"`
	PasswordHash      sql.NullString `json:"password_hash"`
	AccessToken       sql.NullString `json:"access_token"`
	RefreshToken      sql.NullString `json:"refresh_token"`
	ExpiresAt         sql.NullString `json:"expires_at"`
	CreatedAt         string         `json:"created_at"`
	UpdatedAt         string         `json:"updated_at"`
}

type CreateSessionParams

type CreateSessionParams struct {
	ID           string         `json:"id"`
	UserID       string         `json:"user_id"`
	Token        string         `json:"token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    string         `json:"expires_at"`
	CreatedAt    string         `json:"created_at"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
}

type CreateUserParams

type CreateUserParams struct {
	ID        string         `json:"id"`
	Avatar    sql.NullString `json:"avatar"`
	Name      string         `json:"name"`
	Email     sql.NullString `json:"email"`
	CreatedAt string         `json:"created_at"`
	UpdatedAt string         `json:"updated_at"`
	Disabled  int32          `json:"disabled"`
}

type CreateVerificationParams

type CreateVerificationParams struct {
	ID         string `json:"id"`
	Identifier string `json:"identifier"`
	Token      string `json:"token"`
	Type       string `json:"type"`
	ExpiresAt  string `json:"expires_at"`
	CreatedAt  string `json:"created_at"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...any) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...any) *sql.Row
}

type DeleteUserParams

type DeleteUserParams struct {
	ID        string `json:"id"`
	UpdatedAt string `json:"updated_at"`
}

type GetAccountByProviderParams

type GetAccountByProviderParams struct {
	Provider          string         `json:"provider"`
	ProviderAccountID sql.NullString `json:"provider_account_id"`
}

type GetSessionByRefreshTokenParams

type GetSessionByRefreshTokenParams struct {
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    string         `json:"expires_at"`
}

type GetSessionByTokenParams

type GetSessionByTokenParams struct {
	Token     string `json:"token"`
	ExpiresAt string `json:"expires_at"`
}

type GetSessionParams

type GetSessionParams struct {
	ID        string `json:"id"`
	ExpiresAt string `json:"expires_at"`
}

type GetSessionsByUserIDParams

type GetSessionsByUserIDParams struct {
	UserID    string `json:"user_id"`
	ExpiresAt string `json:"expires_at"`
}

type GetVerificationByTokenParams

type GetVerificationByTokenParams struct {
	Token     string `json:"token"`
	ExpiresAt string `json:"expires_at"`
}

type GetVerificationsByIdentifierParams

type GetVerificationsByIdentifierParams struct {
	Identifier string `json:"identifier"`
	ExpiresAt  string `json:"expires_at"`
}

type InvalidateVerificationByIdentifierParams

type InvalidateVerificationByIdentifierParams struct {
	Identifier string `json:"identifier"`
	Type       string `json:"type"`
	ExpiresAt  string `json:"expires_at"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CleanupExpiredSessions

func (q *Queries) CleanupExpiredSessions(ctx context.Context, expiresAt string) error

func (*Queries) CleanupExpiredVerifications

func (q *Queries) CleanupExpiredVerifications(ctx context.Context, expiresAt string) error

func (*Queries) CountUsers

func (q *Queries) CountUsers(ctx context.Context) (int64, error)

func (*Queries) CreateAccount

func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) error

Account queries

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error

Session queries

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error

User queries

func (*Queries) CreateVerification

func (q *Queries) CreateVerification(ctx context.Context, arg CreateVerificationParams) error

Verification queries

func (*Queries) DeleteAccount

func (q *Queries) DeleteAccount(ctx context.Context, id string) error

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id string) error

func (*Queries) DeleteSessionsByUserID

func (q *Queries) DeleteSessionsByUserID(ctx context.Context, userID string) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, arg DeleteUserParams) error

func (*Queries) DeleteVerification

func (q *Queries) DeleteVerification(ctx context.Context, id string) error

func (*Queries) GetAccountByID

func (q *Queries) GetAccountByID(ctx context.Context, id string) (Account, error)

func (*Queries) GetAccountByProvider

func (q *Queries) GetAccountByProvider(ctx context.Context, arg GetAccountByProviderParams) (Account, error)

func (*Queries) GetAccountsByUserID

func (q *Queries) GetAccountsByUserID(ctx context.Context, userID string) ([]Account, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, arg GetSessionParams) (Session, error)

func (*Queries) GetSessionByRefreshToken

func (q *Queries) GetSessionByRefreshToken(ctx context.Context, arg GetSessionByRefreshTokenParams) (Session, error)

func (*Queries) GetSessionByToken

func (q *Queries) GetSessionByToken(ctx context.Context, arg GetSessionByTokenParams) (Session, error)

func (*Queries) GetSessionsByUserID

func (q *Queries) GetSessionsByUserID(ctx context.Context, arg GetSessionsByUserIDParams) ([]Session, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email sql.NullString) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error)

func (*Queries) GetVerificationByToken

func (q *Queries) GetVerificationByToken(ctx context.Context, arg GetVerificationByTokenParams) (Verification, error)

func (*Queries) GetVerificationsByIdentifier

func (q *Queries) GetVerificationsByIdentifier(ctx context.Context, arg GetVerificationsByIdentifierParams) ([]Verification, error)

func (*Queries) InvalidateVerificationByIdentifier

func (q *Queries) InvalidateVerificationByIdentifier(ctx context.Context, arg InvalidateVerificationByIdentifierParams) error

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) UpdateAccount

func (q *Queries) UpdateAccount(ctx context.Context, arg UpdateAccountParams) error

func (*Queries) UpdateSession

func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Session

type Session struct {
	ID           string         `json:"id"`
	UserID       string         `json:"user_id"`
	Token        string         `json:"token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    string         `json:"expires_at"`
	CreatedAt    string         `json:"created_at"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
}

type UpdateAccountParams

type UpdateAccountParams struct {
	ID           string         `json:"id"`
	AccessToken  sql.NullString `json:"access_token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    sql.NullString `json:"expires_at"`
	UpdatedAt    string         `json:"updated_at"`
}

type UpdateSessionParams

type UpdateSessionParams struct {
	ID           string         `json:"id"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    string         `json:"expires_at"`
}

type UpdateUserParams

type UpdateUserParams struct {
	ID        string         `json:"id"`
	Avatar    sql.NullString `json:"avatar"`
	Name      string         `json:"name"`
	Email     sql.NullString `json:"email"`
	UpdatedAt string         `json:"updated_at"`
	Disabled  int32          `json:"disabled"`
}

type User

type User struct {
	ID        string         `json:"id"`
	Avatar    sql.NullString `json:"avatar"`
	Name      string         `json:"name"`
	Email     sql.NullString `json:"email"`
	CreatedAt string         `json:"created_at"`
	UpdatedAt string         `json:"updated_at"`
	Disabled  int32          `json:"disabled"`
}

type Verification

type Verification struct {
	ID         string `json:"id"`
	Identifier string `json:"identifier"`
	Token      string `json:"token"`
	Type       string `json:"type"`
	ExpiresAt  string `json:"expires_at"`
	CreatedAt  string `json:"created_at"`
}

Jump to

Keyboard shortcuts

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