db

package
v0.0.0-...-bb0b79f Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddChannelSyncParams

type AddChannelSyncParams struct {
	FileToSyncUri           string
	DiscordGuildSnowflake   string
	DiscordChannelSnowflake string
}

type AddFileContentChunksParams

type AddFileContentChunksParams struct {
	FilesToSyncFk     int64
	ChunkNumbers      []int32
	DiscordMessageIds []string
}

type AddGithubRepoFileParams

type AddGithubRepoFileParams struct {
	GithubRepoUrl string
	FileToSyncFk  int64
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type FileChunkMessage

type FileChunkMessage struct {
	ID               int64
	FilesToSyncFk    int64
	ChunkNumber      int32
	DiscordMessageID string
}

type FilesToSync

type FilesToSync struct {
	FileToSyncUri           string
	DiscordGuildSnowflake   string
	DiscordChannelSnowflake string
	ID                      int64
	FileContents            string
}

type GetFileContentChunksRow

type GetFileContentChunksRow struct {
	ChunkNumber      int32
	DiscordMessageID string
}

type GetGithubRepoSyncFilesRow

type GetGithubRepoSyncFilesRow struct {
	FilesToSyncID int64
	Url           string
	FileContents  string
	GuildID       string
	ChannelID     string
}

type GetGuildChannelSyncParams

type GetGuildChannelSyncParams struct {
	GuildID   string
	ChannelID string
}

type GithubRepoFile

type GithubRepoFile struct {
	ID            int64
	GithubRepoUrl string
	FileToSyncFk  int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddChannelSync

func (q *Queries) AddChannelSync(ctx context.Context, arg AddChannelSyncParams) (FilesToSync, error)

func (*Queries) AddFileContentChunks

func (q *Queries) AddFileContentChunks(ctx context.Context, arg AddFileContentChunksParams) ([]FileChunkMessage, error)

func (*Queries) AddGithubRepoFile

func (q *Queries) AddGithubRepoFile(ctx context.Context, arg AddGithubRepoFileParams) (GithubRepoFile, error)

func (*Queries) GetChannelSync

func (q *Queries) GetChannelSync(ctx context.Context, fileUri string) (FilesToSync, error)

func (*Queries) GetFileContentChunks

func (q *Queries) GetFileContentChunks(ctx context.Context, channelID string) ([]GetFileContentChunksRow, error)

func (*Queries) GetGithubRepoSyncFiles

func (q *Queries) GetGithubRepoSyncFiles(ctx context.Context, githubRepoUrl string) ([]GetGithubRepoSyncFilesRow, error)

func (*Queries) GetGuildChannelSync

func (q *Queries) GetGuildChannelSync(ctx context.Context, arg GetGuildChannelSyncParams) (FilesToSync, error)

func (*Queries) GetGuildSyncs

func (q *Queries) GetGuildSyncs(ctx context.Context, discordGuildSnowflake string) ([]FilesToSync, error)

func (*Queries) RemoveFileContentChunks

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

func (*Queries) SetFileSyncContents

func (q *Queries) SetFileSyncContents(ctx context.Context, arg SetFileSyncContentsParams) error

func (*Queries) WithTx

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

type SchemaMigration

type SchemaMigration struct {
	Version string
}

type SetFileSyncContentsParams

type SetFileSyncContentsParams struct {
	FileContents string
	ChannelID    string
}

Jump to

Keyboard shortcuts

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