database

package
v0.0.0-...-252d32f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFeedFollowParams

type CreateFeedFollowParams struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
}

type CreateFeedParams

type CreateFeedParams struct {
	ID        uuid.UUID
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
	Url       string
	UserID    uuid.UUID
}

type CreatePostParams

type CreatePostParams struct {
	ID          uuid.UUID
	Title       string
	Description sql.NullString
	PublishedAt time.Time
	Url         string
	FeedID      uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type CreateUserParams

type CreateUserParams struct {
	ID            uuid.UUID
	Name          string
	Email         string
	PasswordHash  string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	OauthProvider sql.NullString
	OauthID       sql.NullString
}

type DBTX

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

type DeleteFeedFollowParams

type DeleteFeedFollowParams struct {
	ID     uuid.UUID
	UserID uuid.UUID
}

type Feed

type Feed struct {
	ID            uuid.UUID
	Name          string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	Url           string
	UserID        uuid.UUID
	LastFetchedAt sql.NullTime
}

type FeedFollow

type FeedFollow struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	UserID    uuid.UUID
	FeedID    uuid.UUID
}

type GetPostsForUserParams

type GetPostsForUserParams struct {
	UserID uuid.UUID
	Limit  int32
}

type Post

type Post struct {
	ID          uuid.UUID
	Title       string
	Description sql.NullString
	PublishedAt time.Time
	Url         string
	FeedID      uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateFeed

func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (Feed, error)

func (*Queries) CreateFeedFollow

func (q *Queries) CreateFeedFollow(ctx context.Context, arg CreateFeedFollowParams) (FeedFollow, error)

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)

func (*Queries) CreateUser

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

func (*Queries) DeleteFeedFollow

func (q *Queries) DeleteFeedFollow(ctx context.Context, arg DeleteFeedFollowParams) error

func (*Queries) GetFeedFollows

func (q *Queries) GetFeedFollows(ctx context.Context, userID uuid.UUID) ([]FeedFollow, error)

func (*Queries) GetFeeds

func (q *Queries) GetFeeds(ctx context.Context) ([]Feed, error)

func (*Queries) GetNextFeedToFetch

func (q *Queries) GetNextFeedToFetch(ctx context.Context, limit int32) ([]Feed, error)

func (*Queries) GetPostsForUser

func (q *Queries) GetPostsForUser(ctx context.Context, arg GetPostsForUserParams) ([]Post, error)

func (*Queries) GetUserByAPIKey

func (q *Queries) GetUserByAPIKey(ctx context.Context, apiKey string) (User, error)

func (*Queries) GetUserByEmail

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

func (*Queries) MarkFeedAsFetched

func (q *Queries) MarkFeedAsFetched(ctx context.Context, id uuid.UUID) (Feed, error)

func (*Queries) UpdateOAuthID

func (q *Queries) UpdateOAuthID(ctx context.Context, arg UpdateOAuthIDParams) (User, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (User, error)

func (*Queries) WithTx

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

type UpdateOAuthIDParams

type UpdateOAuthIDParams struct {
	OauthProvider sql.NullString
	OauthID       sql.NullString
	Email         string
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	PasswordHash string
	Email        string
}

type User

type User struct {
	ID            uuid.UUID
	Name          string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	ApiKey        string
	Email         string
	PasswordHash  string
	OauthProvider sql.NullString
	OauthID       sql.NullString
}

Jump to

Keyboard shortcuts

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