2017 © Pedro PelĂĄez
 

library blueprint

DBAL package that performs data operations through applying patterns

image

sypherlev/blueprint

DBAL package that performs data operations through applying patterns

  • Friday, June 29, 2018
  • by sypherlev
  • Repository
  • 1 Watchers
  • 1 Stars
  • 124 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 29 % Grown

The README.md

PDS Skeleton License: MIT Build Status, (*1)

Blueprint Query Compiler

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

Install via Composer

composer require sypherlev/blueprint, (*3)

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., (*4)

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., (*5)

  • 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., (*6)

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., (*7)

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., (*8)

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., (*9)

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 or RedBean instead., (*10)

The Versions

29/06 2018

dev-master

9999999-dev

DBAL package that performs data operations through applying patterns

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Claire Ryan

database sql query

11/07 2017

1.2.0

1.2.0.0

DBAL package that performs data operations through applying patterns

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Claire Ryan

database sql query

20/01 2017

1.1.0

1.1.0.0

DBAL package that performs data operations through applying patterns

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Claire Ryan

database sql query

16/01 2017

1.0.0

1.0.0.0

DBAL package that performs data operations through applying patterns

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Claire Ryan

database sql query