db

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient interface {
	// GetDB returns the raw *sql.DB instance.
	GetDB() *sql.DB
	// Close closes the database connection.
	Close() error
	// Init initializes the database schema (e.g., creates tables).
	Init() error
	// Ping checks the database connection.
	Ping(ctx context.Context) error
}

DBClient defines the interface for our database operations. This allows us to abstract the underlying database (SQLite, GORM, etc.).

type SQLiteClient

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

SQLiteClient implements DBClient for SQLite databases.

func NewSQLiteClient

func NewSQLiteClient(dataDir, dbName string) (*SQLiteClient, error)

NewSQLiteClient creates and returns a new SQLite database client. dbName is used to construct the file path (e.g., "dxcc.db", "lotw.db").

func (*SQLiteClient) Close

func (s *SQLiteClient) Close() error

Close closes the database connection.

func (*SQLiteClient) GetDB

func (s *SQLiteClient) GetDB() *sql.DB

GetDB returns the raw *sql.DB instance.

func (*SQLiteClient) Init

func (s *SQLiteClient) Init() error

Init is a placeholder for schema initialization. Specific tables will be created by the respective LoTW/DXCC packages.

func (*SQLiteClient) Ping

func (s *SQLiteClient) Ping(ctx context.Context) error

Ping checks the database connection.

Jump to

Keyboard shortcuts

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