PHPackages                             sypherlev/blueprint - 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. sypherlev/blueprint

ActiveLibrary[Database &amp; ORM](/categories/database)

sypherlev/blueprint
===================

DBAL package that performs data operations through applying patterns

1.2.0(8y ago)12701MITPHPPHP &gt;=7.0

Since Jan 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sypherlev/blueprint)[ Packagist](https://packagist.org/packages/sypherlev/blueprint)[ RSS](/packages/sypherlev-blueprint/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (4)Used By (1)

[![PDS Skeleton](https://camo.githubusercontent.com/50d01a5094afcc3a827c3cadaec43d23b2a256cb249f5fdd6e5ffdb53ea7971c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-pds/skeleton) [![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT) [![Build Status](https://camo.githubusercontent.com/aad7aeb17ab9d90da2fb84a717e981dc3afd7a58cbc929fe38ffc81624640db7/68747470733a2f2f7472617669732d63692e6f72672f7379706865726c65762f626c75657072696e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sypherlev/blueprint)

Blueprint Query Compiler
========================

[](#blueprint-query-compiler)

- [Setup](https://github.com/sypherlev/blueprint/blob/master/docs/Setup.md)
- [Sample](https://github.com/sypherlev/blueprint/blob/master/docs/Sample.md)
- [The Query Builder](https://github.com/sypherlev/blueprint/blob/master/docs/QueryBuilder.md)
- [Patterns](https://github.com/sypherlev/blueprint/blob/master/docs/Patterns.md)
- [Filters](https://github.com/sypherlev/blueprint/blob/master/docs/Filters.md)
- [Transformations](https://github.com/sypherlev/blueprint/blob/master/docs/Transformations.md)

Blueprint is an extended query builder that allows you to define, reuse, and override chunks of query code at will.

### Install via Composer

[](#install-via-composer)

`composer require sypherlev/blueprint`

### Background

[](#background)

I found that, while building a number of large, data-driven apps, an ORM just got in the way most of the time, while a query builder meant writing lots of difficult-to-maintain, copy-pasted and possibly-insecure code. As using an ORM didn’t lend itself to what I was trying to do, I started with a query builder and set about fixing those issues instead. The end result is Blueprint.

Blueprint’s core is a fairly robust query builder that allows for most common SQL operations, and a fallback to raw SQL. Blueprint is extended with additional elements that allow for reusable, configured query sections, which cuts the amount of copy-pasting code to a minimum, and includes some built-in security out of the box.

- **Patterns**: A Pattern defines tables, columns, and joins for a query, and the primary table and its columns double as a whitelist when used with INSERT/UPDATE queries.
- **Filters**: A Filter defines additional where clauses, and the limit and orderBy clauses for a query.
- **Transformations**: A Transformation is a simple closure that modifies data going into an INSERT/UPDATE query, and modifies data coming out of a SELECT query.

Patterns, Filters and Transformations are normally defined in the constructor of a Blueprint-extending class and then used as needed in specific methods.

All queries generated by the builder use prepared statements, and there is an additional function, `raw()`, that will accept any arbitrary SQL string with or without bindings.

It currently supports MySQL/MariaDB/PostgreSQL, with an interface definition so that more can be added. The pattern/filter setup can only define whatever comes out of a single query, which means defining one-to-many or many-to-many relationships requires the use of a transformation after the initial query result to append more data as needed.

**Note: there is no functionality to create or modify tables, and I don’t intend to add any at this time.** Blueprint assumes you have a fairly solid working knowledge of SQL already, and you’ve created the schema externally or you’re working with a pre-existing database.

As it’s purpose-built for managing and processing large blocks of complex relational data, Blueprint is not recommended for basic CRUD work. Please look at [Propel](http://propelorm.org/) or [RedBean](https://redbeanphp.com/index.php) instead.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

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 ~88 days

Total

3

Last Release

3229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfbc35f464e0517fc7dc3c289b7f8c285492b2140951322dcb63aa5b75810fdf?d=identicon)[sypherlev](/maintainers/sypherlev)

---

Top Contributors

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

---

Tags

databasemariadbmit-licensemysqlpds-skeletonphp7query-builderdatabasesqlquery

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sypherlev-blueprint/health.svg)

```
[![Health](https://phpackages.com/badges/sypherlev-blueprint/health.svg)](https://phpackages.com/packages/sypherlev-blueprint)
```

###  Alternatives

[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[illuminated/db-profiler

Database Profiler for Laravel Web and Console Applications.

168237.4k](/packages/illuminated-db-profiler)[opis/database

A database abstraction layer over PDO, that provides a powerful and intuitive query builder, bundled with an easy to use schema builder

10184.2k3](/packages/opis-database)[jasny/persist-sql-query

SQL Query builder and parser

33486.0k4](/packages/jasny-persist-sql-query)[atlas/query

Object-oriented query builders and performers for MySQL, Postgres, SQLite, and SQLServer.

41249.0k7](/packages/atlas-query)

PHPackages © 2026

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