mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-08-24 00:22:29 +02:00
feat: add CountEntries to skip decryption for list --detail (#562)
* feat: add CountEntries to skip decryption for list --detail (#549) * test: add CountEntries and countCategory tests at browser level * fix: address review feedback on CountRows and countLocalStorage * test: add CountRows unit tests
This commit is contained in:
@@ -8,7 +8,10 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const defaultHistoryQuery = `SELECT url, title, visit_count, last_visit_time FROM urls`
|
||||
const (
|
||||
defaultHistoryQuery = `SELECT url, title, visit_count, last_visit_time FROM urls`
|
||||
countHistoryQuery = `SELECT COUNT(*) FROM urls`
|
||||
)
|
||||
|
||||
func extractHistories(path string) ([]types.HistoryEntry, error) {
|
||||
histories, err := sqliteutil.QueryRows(path, false, defaultHistoryQuery,
|
||||
@@ -35,3 +38,7 @@ func extractHistories(path string) ([]types.HistoryEntry, error) {
|
||||
})
|
||||
return histories, nil
|
||||
}
|
||||
|
||||
func countHistories(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, false, countHistoryQuery)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user