Documentation
¶
Index ¶
- func BulkInsertRecords(db *sql.DB, filename string, path string) error
- func BulkStoreEvents(db *sql.DB, eventRecordQueue *[]shared.EventRecord) error
- func CommitRecords(db *sql.DB) error
- func CreateDB(pathname string) (*sql.DB, error)
- func DeleteRecord(db *sql.DB, fullpath string) error
- func FullPathLikeQuery(path string) (*[]string, error)
- func FullPathLikeQueryEach(path string, fn func(string)) error
- func InsertRecord(db *sql.DB, filename string, path string, eventID uint64, ...) error
- func OpenDB(pathname string) (*sql.DB, error)
- func OpenDBReadOnly(pathname string) (*sql.DB, error)
- func PrefixSearch(prefix string, limit int) ([]*shared.SearchResult, error)
- func RecordCount(db *sql.DB) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BulkInsertRecords ¶
Collects records and commits them to the database when enough records are collected.
func BulkStoreEvents ¶
func BulkStoreEvents(db *sql.DB, eventRecordQueue *[]shared.EventRecord) error
Stores a batch of events in the database.
func CommitRecords ¶
Commits any collected records to the database.
func DeleteRecord ¶
Deletes a record from the database with the given fullpath.
func FullPathLikeQuery ¶
func FullPathLikeQueryEach ¶
FullPathLikeQueryEach streams matching paths one at a time via the callback, avoiding materializing all results into a slice.
func InsertRecord ¶
func InsertRecord(db *sql.DB, filename string, path string, eventID uint64, objectType shared.ObjectType) error
Inserts a new record into the database.
func OpenDBReadOnly ¶
Open read-only for the UI. Can't use PRAGMAS in read-only mode.
func PrefixSearch ¶
func PrefixSearch(prefix string, limit int) ([]*shared.SearchResult, error)
Performs a substring search for filenames containing the given term. For terms >= 3 characters, uses FTS5 trigram index for fast lookup. For shorter terms, uses prefix search with the B-tree index.
Types ¶
This section is empty.