{"id":23086683,"url":"https://github.com/sypherlev/blueprint","last_synced_at":"2026-05-05T09:33:03.849Z","repository":{"id":57063982,"uuid":"70721051","full_name":"sypherlev/blueprint","owner":"sypherlev","description":"DBAL package that performs data operations through applying reusable code","archived":false,"fork":false,"pushed_at":"2020-07-20T15:17:48.000Z","size":166,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T20:24:05.763Z","etag":null,"topics":["database","mariadb","mit-license","mysql","pds-skeleton","php7","query-builder"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sypherlev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-12T16:51:38.000Z","updated_at":"2020-07-20T15:17:50.000Z","dependencies_parsed_at":"2022-08-24T10:10:06.378Z","dependency_job_id":null,"html_url":"https://github.com/sypherlev/blueprint","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sypherlev/blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sypherlev%2Fblueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sypherlev%2Fblueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sypherlev%2Fblueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sypherlev%2Fblueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sypherlev","download_url":"https://codeload.github.com/sypherlev/blueprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sypherlev%2Fblueprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mariadb","mit-license","mysql","pds-skeleton","php7","query-builder"],"created_at":"2024-12-16T19:29:32.881Z","updated_at":"2026-05-05T09:33:03.823Z","avatar_url":"https://github.com/sypherlev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square)](https://github.com/php-pds/skeleton) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/sypherlev/blueprint.svg?branch=master)](https://travis-ci.org/sypherlev/blueprint)\n\n# Blueprint Query Compiler\n\n* [Setup](https://github.com/sypherlev/blueprint/blob/master/docs/Setup.md)\n* [Sample](https://github.com/sypherlev/blueprint/blob/master/docs/Sample.md)\n* [The Query Builder](https://github.com/sypherlev/blueprint/blob/master/docs/QueryBuilder.md)\n* [Patterns](https://github.com/sypherlev/blueprint/blob/master/docs/Patterns.md)\n* [Filters](https://github.com/sypherlev/blueprint/blob/master/docs/Filters.md)\n* [Transformations](https://github.com/sypherlev/blueprint/blob/master/docs/Transformations.md)\n\nBlueprint is an extended query builder that allows you to define, reuse, and override chunks of query code at will.\n\n### Install via Composer\n\n`composer require sypherlev/blueprint`\n\n### Background\n\nI 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.\n\nBlueprint’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.\n\n* **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.\n* **Filters**: A Filter defines additional where clauses, and the limit and orderBy clauses for a query.\n* **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.\n\nPatterns, Filters and Transformations are normally defined in the constructor of a Blueprint-extending class and then used as needed in specific methods.\n\nAll 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.\n\nIt 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.\n\n**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.\n\nAs 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsypherlev%2Fblueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsypherlev%2Fblueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsypherlev%2Fblueprint/lists"}