PHPackages                             qbbr/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. qbbr/pgsql-doctrine-random-function

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

qbbr/pgsql-doctrine-random-function
===================================

PostgreSQL RANDOM() function for Doctrine ORM

1.0.1(10y ago)4117.9k↓25.4%2[2 PRs](https://github.com/qbbr/PgsqlDoctrineRandomFunction/pulls)MITPHP

Since Mar 11Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (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 qbbr/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

38

—

LowBetter than 85% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3720d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a723620ded3e1eacda793c4f652fd43981ac0689fce8a8267ef481d44fdd7c7?d=identicon)[qbbr](/maintainers/qbbr)

---

Top Contributors

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

---

Tags

doctrine-ormphppostgresqlsymfonyrandomsymfonydoctrinepostgresqlpgsqlfunctionqbbr

### Embed Badge

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

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

###  Alternatives

[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[oro/doctrine-extensions

Doctrine Extensions for MySQL and PostgreSQL.

34411.8M19](/packages/oro-doctrine-extensions)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[boldtrn/jsonb-bundle

A library adding the support for JSONB columns of PostgreSQL to Doctrine.

57817.6k](/packages/boldtrn-jsonb-bundle)[goodwix/doctrine-json-odm

JSON Object-Document Mapping bundle for Symfony and Doctrine

2226.0k](/packages/goodwix-doctrine-json-odm)

PHPackages © 2026

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