PHPackages                             aldaflux/pgsql-doctrine-random-function - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. aldaflux/pgsql-doctrine-random-function

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

aldaflux/pgsql-doctrine-random-function
=======================================

PostgreSQL RANDOM() function for Doctrine ORM, fork from https://packagist.org/packages/qbbr/pgsql-doctrine-random-function

0314↓33.3%PHP

Since Aug 16Pushed 1y agoCompare

[ Source](https://github.com/AlDaFlux/PgsqlDoctrineRandomFunction)[ Packagist](https://packagist.org/packages/aldaflux/pgsql-doctrine-random-function)[ RSS](/packages/aldaflux-pgsql-doctrine-random-function/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

PgsqlDoctrineRandomFunction
===========================

[](#pgsqldoctrinerandomfunction)

PostgreSQL RANDOM() function for Doctrine ORM

[![Latest Stable Version](https://camo.githubusercontent.com/aef2ee2d837a19f78cdf34b1246339a31db7b150cf341207f4932eafa7e535d1/68747470733a2f2f706f7365722e707567782e6f72672f716262722f706773716c2d646f637472696e652d72616e646f6d2d66756e6374696f6e2f762f737461626c65)](https://packagist.org/packages/qbbr/pgsql-doctrine-random-function)[![Total Downloads](https://camo.githubusercontent.com/7c446cfa9ee9e3b579c007d35ef65e58e07ed98d053a538ea215b0f1f94467b7/68747470733a2f2f706f7365722e707567782e6f72672f716262722f706773716c2d646f637472696e652d72616e646f6d2d66756e6374696f6e2f646f776e6c6f616473)](https://packagist.org/packages/qbbr/pgsql-doctrine-random-function)[![License](https://camo.githubusercontent.com/562c16b27a42591f1bbc39566849c332af09a1b2549d1e91b124c45f7132bc7c/68747470733a2f2f706f7365722e707567782e6f72672f716262722f706773716c2d646f637472696e652d72616e646f6d2d66756e6374696f6e2f6c6963656e7365)](https://packagist.org/packages/qbbr/pgsql-doctrine-random-function)

Installation
------------

[](#installation)

### Step 1: Download the package

[](#step-1-download-the-package)

```
$ composer require aldaflux/pgsql-doctrine-random-function
```

### Step 2: Configuration

[](#step-2-configuration)

```
# app/config/config.yml

doctrine:
    orm:
        # ...
        dql:
            numeric_functions:
                Random: Qbbr\PgsqlDoctrineRandomFunction\DQL\RandomFunction
```

Usage
-----

[](#usage)

```
$em = $this->getDoctrine()->getManager();

$result = $em->createQueryBuilder()
    ->select('e')
    ->from('AppBundle:Entity', 'e')
    ->orderBy('RANDOM()')
    ->setMaxResults(10)
    ->getQuery()
    ->getResult();
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a9e1a84963980fb40b742b359a1dfebce0e7f04abbb06d55188e3001fcdc659?d=identicon)[AntoineInDa](/maintainers/AntoineInDa)

---

Top Contributors

[![AlDaFlux](https://avatars.githubusercontent.com/u/32897236?v=4)](https://github.com/AlDaFlux "AlDaFlux (6 commits)")[![qbbr](https://avatars.githubusercontent.com/u/131593?v=4)](https://github.com/qbbr "qbbr (4 commits)")

### Embed Badge

![Health badge](/badges/aldaflux-pgsql-doctrine-random-function/health.svg)

```
[![Health](https://phpackages.com/badges/aldaflux-pgsql-doctrine-random-function/health.svg)](https://phpackages.com/packages/aldaflux-pgsql-doctrine-random-function)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
