Download the PHP package atk4/dsql without Composer
On this page you can find all versions of the php package atk4/dsql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package dsql
⚠️ repo was integrated into atk4/data ⚠️
DSQL is a composable SQL query builder. You can write multi-vendor queries in PHP profiting from better security, clean syntax and avoid human errors.
Hold on! Why yet another query builder?
Obviously because existing ones are not good enough. DSQL tries to do things differently:
- Composability. Unlike other libraries, we render queries recursively allowing many levels of sub-selects.
- Small footprint. We don't duplicate query code for all vendors, instead we use clever templating system.
- Extensibility. We have 3 different ways to extend DSQL as well as 3rd party vendor driver support.
- Any Query - any query with any complexity can be expressed through DSQL.
- Almost no dependencies. Use DSQL in any PHP application or framework.
- NoSQL support. In addition to supporting PDO, DSQL can be extended to deal with SQL-compatible NoSQL servers.
DSQL Is Stable!
DSQL has been in production since 2006, initially included in AModules2 and later Agile Toolkit. We simply forked it and cleaned it up for you:
DSQL Is Simple and Powerful
If the basic query is not fun, how about more complex one?
This builds and executes a single query that looks like this:
DSQL is part of Agile Data
Building SQL queries might be fun, but why not take it to the next level?
Domain Model
Agile Data is my other project, which implements Domain Model Persistence on top of DSQL. You still maintain control over your queries while also benefiting from database abstraction.
Next example uses Agile Data's method "action()" to pre-populate DSQL object:
User Inerface
Agile UI is my other project that focuses on data visualization.
If you wonder what's the most efficient way to display table like that on your page, with Agile UI, Agile Data and DSQL you can do it in less than 10 lines:
Limitations of DSQL
Our team intentionally keeps DSQL simple. The following features are deliberately excluded:
- no knowledge of your database schema (see https://github.com/atk4/schema).
- no reliance on any usage pattern in your database or presence of specific tables.
- no decision making based on supplied data values.
- no active record or object relational mapping
If you need features above, I strongly advise you to look into Agile Data.
Documentation cheat-sheet
DSQL has extensive documentation at http://dsql.readthedocs.org, but below we have linked some of the frequent topics:
- querying data from table() or sub-select with join(), where(), order(), group(), limit(), having() and option()
- update/replace single or multiple records with set(), where() and option()
- insert one or multiple records with set() or setAll() and option()
- delete records with where()
- iterate through result-set or getRows() all data
- supporting sub-queries and expressions anywhere
Community and Support
All versions of dsql with dependencies
ext-pdo Version *
atk4/core Version ~2.4.0
doctrine/dbal Version ^2.10 || ^3.0