Skip to content

v1.2.8

Choose a tag to compare

@coagus coagus released this 19 Dec 20:51
· 90 commits to main since this release

Version 1.2.8 (December 19, 2025)

πŸŽ‰ New Features

Enhanced Filtering Capabilities for getAll Operations

This release introduces powerful new filtering capabilities that allow you to filter results by specific fields and perform full-text search simultaneously when using getAll operations.

Field-Based Filtering:

  • You can now filter results by any field in your entity by passing the field name and value as query parameters
  • Multiple field filters can be combined using AND logic
  • Example: GET /api/v1/users?name=John&active=1 will return users where name equals "John" AND active equals 1

Search Functionality:

  • The existing search parameter now works seamlessly alongside field filters
  • Search performs a LIKE query across all fields using OR logic
  • Example: GET /api/v1/users?search=john will search for "john" in all fields

Combined Filtering:

  • Field filters and search can be used together
  • Field filters are applied first (AND), then search is applied (OR across all fields)
  • Example: GET /api/v1/users?active=1&search=john will return active users that match "john" in any field

πŸ”§ Improvements

  • Code Refactoring: Improved code organization by separating field extraction and WHERE clause construction logic
  • Better Maintainability: Enhanced code readability and efficiency in the DataBase class
  • Performance: Optimized query building process for better performance

πŸ“ Technical Details

  • Refactored getWhereSearch() method into two private methods:
    • getFields(): Extracts available fields from the query result
    • getWhere(): Constructs the WHERE clause combining field filters and search conditions
  • Field filters are automatically detected from query parameters that match entity field names
  • Empty field values are ignored to prevent unnecessary filtering

πŸ”„ Migration Notes

This release is backward compatible. Existing APIs using the search parameter will continue to work as before. The new field-based filtering is opt-in and does not affect existing functionality.