Commit Graph

2 Commits

Author SHA1 Message Date
Hadi Mottale 07cdb55411 fix: Ensure accurate Total Count and correct Limit=0 handling
This commit finalizes the complex querying logic:
- **Refactor `GetAll` (sqlite.go):** Reworks the internal logic to ensure the total number of matching records (`totalCount`) is calculated via a separate COUNT query *before* applying LIMIT/OFFSET.
- **Corrected Pagination:** Adds an explicit check in `GetAll` to return an empty `items` list when `limit=0`, while still reporting the correct `totalCount`.
- **API Handler Update:** Consumes the accurate `totalCount` returned by the Store layer and includes it in the final API response under the `totalItems` field.
2025-11-22 10:57:15 +03:30
Hadi Mottale 4704d7802b feat: Initial project setup and core API functionality
This commit introduces the initial structure for the data platform, including:

- **Core Structure:** Setup of basic Go modules, environment, and project layers (cmd, internal, pkg).
- **SQLite Store:** Implements data persistence using SQLite, including schema initialization (collections/records).
- **CRUD Operations:** Full C.R.U.D. logic for records within collections.
- **Dynamic Querying:** Implements advanced query features over JSON data:
    - **Filtering:** Dynamic filters (eq, gt, lt, etc.) on JSON fields using SQL casting (`CAST(... AS REAL)`).
    - **Pagination:** Support for `limit` and `offset` query parameters.
    - **Sorting:** Dynamic sorting based on JSON fields (`orderBy=field` or `orderBy=-field`).
2025-11-03 13:42:53 +03:30