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.
Click to show internal directories.
Click to hide internal directories.