Key Features
Type-Safe
All queries are validated against your schema before execution
Chainable API
Build complex queries by chaining methods together
Field Projection
Select only the fields you need with
Select()Eager Loading
Avoid N+1 queries with
Include() for relationsBasic Query Structure
All queries follow this pattern:Example Schema
All examples in this section use the following schema:Fetch All Records
Retrieve all instances from an entity:Field Projection
Select only the fields you need:Query Validation
All queries are validated before execution. ChameleonDB will catch these errors at compile time:| Error | Example |
|---|---|
| Unknown entity | db.Products() when Product is not in schema |
| Unknown field | .Filter("phone", ...) when phone is not a field |
| Invalid relation path | .Include("orders.address") when address doesn’t exist |
| Type mismatch | .Filter("age", "eq", "not a number") |
| Missing order with pagination | .Limit(10) without .OrderBy() warns |
Debug Mode
See the generated SQL for any query:Debug mode is useful during development to understand how your queries translate to SQL.