* Refactor DNS log pagination to use LIMIT and OFFSET
Replaced the previous ROW_NUMBER()-based pagination with a simpler and more efficient approach using SQL LIMIT and OFFSET clauses. This change removes unnecessary subqueries and row number calculations, improving code clarity and query performance for paginated DNS log retrieval.
* Add sequential row numbers to DnsLogEntry results
Replace database ID with a calculated row number in DnsLogEntry objects, assigning sequential numbers based on the current page and sort order. This ensures each entry reflects its position in the paginated result set rather than its database ID.
* Improve pagination and query efficiency in DNS log queries
Refactored QueryLogsAsync to better handle invalid page numbers,
ensuring pageNumber is always within valid bounds. Database queries
are now only executed if there are entries to fetch, preventing
unnecessary queries and improving efficiency. Indented and grouped
parameter setup and result reading logic for clarity and correctness.
* Stricter validation for pageNumber in QueryLogsAsync
Changed pageNumber check to require values >= 1 instead of >= 0,
ensuring that page 0 cannot be used in log queries.
* Refactor log pagination to use SQL OFFSET/LIMIT
Replaced manual row range and ROW_NUMBER() logic with SQL OFFSET/LIMIT (SQLite) and OFFSET/FETCH (SQL Server) for more efficient pagination in QueryLogsAsync. Row numbers are now calculated in code, and queries are only executed if there are entries to fetch. This improves performance, readability, and maintainability.
* Refactor SQL param handling and reader loop logic
Refactored parameter addition to SQL commands to use explicit null checks, improving robustness and readability. Changed `@qclass` type from `ushort` to `short` for SQL Server. Updated `totalEntries` calculation to handle null results safely. Moved variable declarations and null checks inside the database reader loop, and restructured row number logic for clarity. No changes to query functionality.