{"modulePath":"github.com/moond4rk/hackbrowserdata","version":"v1.1.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sqliteutil\n\n## Functions\n\n```go\nfunc CountRows(dbPath string, journalOff bool, query string) (int, error)\n```\nCountRows runs a scalar count query (e.g. SELECT COUNT(\\*) FROM ...) and returns the integer result. Unlike QuerySQLite (which swallows per-row scan errors), CountRows uses QueryRow for fail-fast behavior on scan failures.\n\n```go\nfunc QueryRows[T any](dbPath string, journalOff bool, query string, scanRow func(*sql.Rows) (T, error)) ([]T, error)\n```\nQueryRows is a generic helper (Go 1.18+) that wraps QuerySQLite and collects results into a typed slice. Each extract method only needs to provide the scan function that converts one database row into a typed value.\n\nRows that fail to scan are skipped (logged at debug level by QuerySQLite).\n\n```go\nfunc QuerySQLite(dbPath string, journalOff bool, query string, scanFn func(*sql.Rows) error) error\n```\nQuerySQLite opens a SQLite database, optionally disables journal mode (required for Firefox databases), runs the query, and calls scanFn for each row.\n\nIt validates the database file exists before opening to prevent sql.Open from silently creating an empty database.\n\nscanFn should return nil to continue iteration, or an error to skip the current row (the error is logged at debug level and iteration continues).\n\n","path":"github.com/moond4rk/hackbrowserdata/utils/sqliteutil","name":"sqliteutil","synopsis":"","isRedistributable":true}
