db

package
v0.0.0-...-2025082 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Conn *sql.DB
}

func Connect

func Connect(databaseURL string) *Database

func (*Database) Close

func (db *Database) Close() error

Ensure the connection is closed when the application shuts down

func (*Database) GetCommandsRunCount

func (db *Database) GetCommandsRunCount(ctx context.Context) (int, error)

GetCommandsRunCount returns the total number of commands run from the command_logs table

func (*Database) GetGuildConfig

func (db *Database) GetGuildConfig(ctx context.Context, guildID string) (*GuildConfig, error)

func (*Database) IncrementCommandRun

func (db *Database) IncrementCommandRun(ctx context.Context, guildID, userID, commandName string) error

IncrementCommandRun logs a command execution for tracking

func (*Database) Migrate

func (db *Database) Migrate()

func (*Database) Ping

func (db *Database) Ping() error

func (*Database) SetLogChannel

func (db *Database) SetLogChannel(ctx context.Context, guildID string, channelID string) error

type GuildConfig

type GuildConfig struct {
	GuildID      string
	LogChannelID *string
}

Jump to

Keyboard shortcuts

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