Skip to content

Release 0.4.0 - reduce boilerplate

Latest
Compare
Choose a tag to compare
@sad-spirit sad-spirit released this 31 Aug 15:48

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()