Repository navigation
v2.1.0
New Features
Advanced Filter Methods
New chainable filter methods added:
// OR condition
$db->query("users")
->where(["department" => "IT"])
->orWhere(["department" => "Engineering"])
->orWhere(["role" => "admin"])
->get();
// Array membership
$db->query("users")
->whereIn("status", ["active", "pending"])
->whereNotIn("role", ["banned", "suspended"])
->get();
// Negation filters
$db->query("users")
->whereNot(["deleted" => true])
->notLike("email", "test")
->notBetween("age", 0, 18)
->get();New Methods:
orWhere($filters)- OR condition filteringwhereIn($field, $values)- Value in arraywhereNotIn($field, $values)- Value not in arraywhereNot($filters)- Not equal filternotLike($field, $pattern)- Pattern should not matchnotBetween($field, $min, $max)- Value outside range
Full-Text Search
Multi-field search support:
$results = $db->query("products")
->search("wireless keyboard")
->get();
// Search in specific fields
$results = $db->query("users")
->search("john", ["name", "email", "bio"])
->get();Database Joins
Cross-database join support:
$orders = $db->query("orders")
->where(["status" => "completed"])
->join("users", "user_id", "id")
->get();
// Each order now includes related user dataGrouping & Aggregation
GROUP BY and HAVING support:
$categories = $db->query("products")
->groupBy("category")
->having("count", ">", 10)
->having("avg:price", ">", 100)
->get();Having aggregate types:
count- Group countsum:field- Field sumavg:field- Field averagemin:field- Minimum valuemax:field- Maximum value
Field Projection
Select or exclude fields from results:
// Get only specific fields
$users = $db->query("users")
->select(["name", "email", "avatar"])
->get();
// Exclude sensitive fields
$users = $db->query("users")
->except(["password", "token", "secret_key"])
->get();removeFields() Terminal Method
Permanently remove fields from matching records:
$result = $db->query("users")
->where(["status" => "deleted"])
->removeFields(["personal_data", "payment_info"]);
// ["n" => 5, "fields_removed" => ["personal_data", "payment_info"]]Features:
- Works with sharded databases
keyfield is protected (cannot be removed)- Can be combined with all filter methods
Method Aliases
Convenience aliases:
->skip(20) // Same as offset(20)
->orderBy("name", "asc") // Same as sort("name", "asc")Bug Fixes
- whereIn/whereNotIn null handling: Fixed null value filtering by using
array_key_exists()instead ofisset() - join() array/object key handling: Fixed crash when local or foreign key values are arrays or objects - now gracefully returns null for non-scalar keys
Improvements
Test Suite
- 723 tests, 1916 assertions (v2.0: 448 tests, 1005 assertions)
- +275 new tests added
NewChainingMethodsTest.php- 100 tests (new methods)NewMethodsEdgeCasesTest.php- 50 tests (edge cases)NewMethodsShardedTest.php- 18 tests (sharded DB support)RemoveFieldsTest.php- 29 tests (removeFields)TypeEdgeCasesTest.php- 79 tests (type validation & edge cases)
Documentation
README.md- All new methods documentedCLAUDE.md- Developer guide updated- Method Chaining section organized into 5 categories
- 15+ new code examples added
Breaking Changes
None. All v2.0.x APIs remain backward compatible.
Migration Guide
CRITICAL: Before updating, backup your
$secretKeyfrom the oldnoneDB.php. Restore it after update or you'll lose access to your data!
To upgrade from v2.0.x to v2.1.0:
- Backup your
$secretKeyfrom currentnoneDB.php - Update
noneDB.phpfile - Restore your
$secretKeyin the new file - Start using new features (optional)