quellabs / objectquel
A sophisticated ORM system with a unique query language and streamlined architecture
Fund package maintenance!
Requires
- php: >=8.3
- ext-json: *
- ext-pdo: *
- cakephp/database: ^5.3
- quellabs/annotation-reader: ^1
- quellabs/contracts: ^1
- quellabs/sculpt: ^1
- quellabs/signal-hub: ^1
- quellabs/support: ^1
- softcreatr/jsonpath: ^0.8
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 2.15.3
- 2.15.2
- 2.15.1
- 2.15.0
- 2.14.1
- 2.14.0
- 2.13.7
- 2.13.6
- 2.13.5
- 2.13.4
- 2.13.3
- 2.13.2
- 2.13.1
- 2.13.0
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.0
- 2.10.1
- 2.10.0
- 2.9.1
- 2.9.0
- 2.8.6
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.0
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.13
- 2.4.12
- 2.4.11
- 2.4.10
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.12.0
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.1
- 1.10.0
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.18
- 1.6.17
- 1.6.16
- 1.6.15
- 1.6.14
- 1.6.13
- 1.6.12
- 1.6.11
- 1.6.10
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.80
- 1.0.79
- 1.0.78
- 1.0.77
- 1.0.76
- 1.0.75
- 1.0.74
- 1.0.73
- 1.0.72
- 1.0.71
- 1.0.70
- 1.0.69
- 1.0.68
- 1.0.67
- 1.0.66
- 1.0.65
- 1.0.64
- 1.0.63
- 1.0.62
- 1.0.61
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-10-01 10:09:08 UTC
README
ObjectQuel is a query language and ORM for PHP. Query mapped entities, traverse relationships, combine database and JSON sources, and let ObjectQuel compile the database work for MySQL/MariaDB, PostgreSQL, SQLite, or SQL Server.
$results = $entityManager->executeQuery(' range of p is App\Entity\Product range of c is App\Entity\Category via p.categories retrieve (p, categoryName = c.name) where p.price < :maxPrice and c.active = true sort by p.name asc ', ['maxPrice' => 50.00]);
Installation
composer require quellabs/objectquel
Upgrading to 2.0
Version 2.0 changes relationship annotations: @OneToMany and the non-owning form of @OneToOne are replaced by @InverseOf(targetEntity=..., relation="..."). @OneToOne now marks only the side that owns the foreign key. For example:
/** @Orm\InverseOf(targetEntity=PostEntity::class, relation="user") */ public CollectionInterface $posts;
Quick start
use Quellabs\ObjectQuel\Configuration; use Quellabs\ObjectQuel\EntityManager; $config = new Configuration(); $config->setEntityNamespace('App\\Entity'); $config->setEntityPath(__DIR__ . '/src/Entity'); $entityManager = new EntityManager($config, $connection); $product = $entityManager->find(Product::class, 101); $results = $entityManager->executeQuery(' range of p is App\Entity\Product retrieve (p) where p.name = /^Tech/i sort by p.createdAt desc window 0, 10 ');
ObjectQuel supports regex and wildcard predicates, full-text search, existence checks, and queries that join mapped entities with JSON sources. It can split a query across database and PHP stages when needed. See the query language guide for examples and syntax.
Writes, DDL, and EQUEL
Use append, replace, and delete for set-based writes through executeQuery(). These bypass the Unit of Work; use persist() and flush() when you need entity lifecycle behavior. See the write statements.
Schema statements include create, alter, destroy, and index operations. Use DDL queries for ad hoc schema work and migrations for maintained schemas.
EQUEL defines stored functions in ObjectQuel syntax. A value-returning definition produces a database function; void produces a database procedure. For example:
$entityManager->executeQuery('define function double_value (int value) int { return value * 2 }'); $result = $entityManager->executeQuery('double_value(:value)', ['value' => 21]);
EQUEL supports MySQL/MariaDB, PostgreSQL, and SQL Server. A definition fails if its name already exists; use destroy function before redefining it. See the EQUEL guide for function bodies, calls, and engine notes.
ORM and tooling
ObjectQuel includes entity and relationship mapping, a Unit of Work, lazy loading, optimistic locking, lifecycle events, repositories, and migrations. Its Sculpt CLI can generate entities from scratch or existing tables and create or run migrations:
php bin/sculpt make:entity php bin/sculpt make:entity-from-table php bin/sculpt make:migrations php bin/sculpt quel:migrate
It works standalone or with Canvas through quellabs/canvas-objectquel.
Documentation
The full query language and ORM reference is at objectquel.com/docs.
Support
If ObjectQuel saves you time, consider sponsoring development.
License
MIT