artemeon / database
Database access layer for the AGP@ARTEMEON software suite.
Requires
- php: >=8.4
- phpmyadmin/sql-parser: ^5.10
- psr/log: ^1|^2|^3
- symfony/polyfill-mbstring: ^1.15
- symfony/process: ^5.0|^6.0|^7.0|^8.0
Requires (Dev)
- laravel/pint: ^1.20.0
- mockery/mockery: ^1.6
- pestphp/pest: ^5.0
- pestphp/pest-plugin-phpstan: ^5.2
- pestphp/pest-plugin-type-coverage: ^5.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^2.1.2
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-phpunit: ^2.0.4
- rector/rector: 2.0.7
Suggests
- ext-mysqli: install for mysql.
- ext-pgsql: install for postgres.
Provides
None
Conflicts
None
Replaces
None
- 5.x-dev
- 5.1.0
- 5.0.1
- 5.0.0
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.x-dev
- 4.0.1
- 4.0.0
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.x-dev
- 3.0.2
- 3.0.1
- 3.0.0
- v2.1.0
- 2.0.x-dev
- v2.0.11
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.0.x-dev
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- 0.2.x-dev
- v0.2.15
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-fix/transaction-counter-below-zero
- dev-feat/doctrine-query-builder
- dev-chore/+77-deprecate-legacy-methods
- dev-feat/+86-unbuffered-queries
- dev-fix/param-types
- dev-add-column-check
- dev-add-group-concat
- dev-fix/3.0/schema-cache
- dev-master
- dev-feat/ci-phpbench
- dev-feat/+25-remove-auto-escaping
- dev-feat/php8.1-compat
- dev-fix/+4323-fix-like-escaping-and-json-encoding
- dev-feat/use-doctrine-dbal
- dev-feat/splitup-connection-interface
- dev-feat/+10-drop-column
This package is auto-updated.
Last update: 2026-12-01 09:10:55 UTC
README
The following matrix shows the Branch to AGP version mapping
| Branch | AGP |
|---|---|
4.0.x |
11.0 |
3.0.x |
10.0 |
0.2.x |
9.0 |
Query builder
Connection::createQueryBuilder() returns a Doctrine DBAL QueryBuilder
whose queries run through the existing Artemeon connection (same driver, same transaction):
$qb = $connection->createQueryBuilder(); $rows = $qb ->select('title', 'year') ->from('books') ->where($qb->expr()->in('id', ':ids')) ->setParameter('ids', ['b-1', 'b-3'], ArrayParameterType::STRING) ->setMaxResults(10) ->executeQuery() ->fetchAllAssociative();
Works with the mysqli, postgres and sqlite3 drivers. lastInsertId() is not supported.
Parameters are passed to the database as they are, like with the fetch*() methods. Unlike getPArray() and
executeStatement(), the query builder does not HTML-encode them. Data written with HTML encoding (e.g. by an ORM on
top of this library) therefore only matches if you encode the value the same way yourself:
$encode = static fn (string $value): string => htmlspecialchars(html_entity_decode($value, ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8'); $qb->where('title = :title')->setParameter('title', $encode('A & B')); // matches 'A & B'
This is the encoding getPArray() and executeStatement() apply. Also use it when writing to columns that are read or
rendered as encoded text, and for values passed to expr()->literal(). Leave numbers, IDs and booleans as they are.
Results are returned as stored, without decoding.
A runnable demo lives in examples/query_builder_sqlite.php.