db

package
v0.0.0-...-992561c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeedData = []struct {
	OS          string
	Command     string
	Description string

}{}/* 805 elements not displayed */

SeedData contains initial command data for different operating systems

Functions

func SeedDatabase

func SeedDatabase(db *DB) error

SeedDatabase populates the database with initial command data

Types

type DB

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

DB holds the database connection

func NewDB

func NewDB() (*DB, error)

NewDB creates a new database connection and initializes the schema

func (*DB) AddCommand

func (db *DB) AddCommand(os, command, description string) error

AddCommand adds a new command to the database

func (*DB) Close

func (db *DB) Close() error

Close closes the database connection

func (*DB) DeleteCommand

func (db *DB) DeleteCommand(id int) error

DeleteCommand deletes a command by ID

func (*DB) SearchCommands

func (db *DB) SearchCommands(keyword, os string, allOS bool) ([]models.Command, error)

SearchCommands searches for commands by keyword

Jump to

Keyboard shortcuts

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