history

package
v0.0.0-...-62ccd28 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddQuery

func AddQuery(query string, duration time.Duration, rows int, profile string) (string, error)

AddQuery adds a query to the history database

func ClearHistory

func ClearHistory(olderThan time.Time) (int64, error)

ClearHistory clears all or part of the query history

func Close

func Close() error

Close closes the database connection

func Initialize

func Initialize() error

Initialize sets up the history database

Types

type QueryHistory

type QueryHistory struct {
	ID        string        `json:"id"`
	Timestamp time.Time     `json:"timestamp"`
	Query     string        `json:"query"`
	Duration  time.Duration `json:"duration"`
	Rows      int           `json:"rows"`
	Profile   string        `json:"profile"`
}

QueryHistory represents a stored query with metadata

func FuzzySearchQueries

func FuzzySearchQueries(searchTerm string, limit int) ([]QueryHistory, error)

FuzzySearchQueries performs a fuzzy search on the query history

func GetQueries

func GetQueries(limit int, offset int) ([]QueryHistory, error)

GetQueries retrieves query history entries

func GetQueryByID

func GetQueryByID(id string) (*QueryHistory, error)

GetQueryByID retrieves a specific query by ID

func SearchQueries

func SearchQueries(searchTerm string, limit int) ([]QueryHistory, error)

SearchQueries searches query history with a search term

Jump to

Keyboard shortcuts

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