Releases: sad-spirit/pg-gateway
Releases · sad-spirit/pg-gateway
Release 0.4.0 - reduce boilerplate
Instead of
$locator->createGateway('messages')
->select(
$locator->createBuilder('messages')
->outputColumns(fn(ColumnsBuilder $cb) => $cb->primaryKey())
->orderBy('added desc')
->limit(1)
)
->getIterator()
->current()
it is now possible to write
$locator->select('messages', fn(FluentBuilder $builder) => $builder
->outputColumns()
->primaryKey()
->orderBy('added desc')
->limit(1))
->fetchFirst()
Release 0.3.0 - simplify custom metadata
Implementations of methods defined in metadata\Columns
, metadata\PrimaryKey
, and metadata\References
interfaces were moved from metadata\Table*
classes into traits. This separates the code that loads metadata from DB / cache and the code that accesses that metadata, allowing reuse of the latter.
Release 0.2.1 - composer name fix
Package name in composer.json
was changed from sad_spirit/pg-gateway
to the intended sad_spirit/pg_gateway
(dash to underscore)
Release 0.2.0 - API refinement
- Reworked metadata classes to make it possible to create gateways to relations that are not ordinary tables (views, foreign tables...)
TableGateway
no longer extendsTableDefinition
, instances ofTableGateway
are now configured with instances ofTableDefinition
- Extracted builder methods from
GenericTableGateway
to a newFluentBuilder
class. Builders are created by a newTableLocator::createBuilder()
method backed by implementations ofTableGatewayFactory
. - Added
NameMappingGatewayFactory
implementation ofTableGatewayFactory
that maps table names to class names. - Added fragments and builder methods that populate the
WITH
clause.
Initial release
While version is only 0.1.0, the previous variant of this code was used in production for a few years.