atk4/data
ATK Data is a PHP data model abstraction that separates business logic from UI and persistence. Works with SQL/NoSQL/APIs, supports relations, expressions, aggregation, and user actions with ACL metadata—integrates easily with ATK UI and ATK API.
:::{php:namespace} Atk4\Data\Persistence\Sql :::
DSQL is a dynamic SQL query builder. You can write multi-vendor queries in PHP profiting from better security, clean syntax and most importantly – sub-query support. With DSQL you stay in control of when queries are executed and what data is transmitted. DSQL is easily composable – build one query and use it as a part of other query.
The simplest way to explain DSQL is by example:
$query = $connection->dsql();
$query->table('employees')
->where('birth_date', '1961-05-02')
->field('count(*)');
echo 'Employees born on May 2, 1961: ' . $query->getOne();
The above code will execute the following query:
select count(*) from `salary` where `birth_date` = :a
:a = "1961-05-02"
DSQL can also execute queries with multiple sub-queries, joins, expressions grouping, ordering, unions as well as queries on result-set.
quickstart if you would like to start learning DSQL.DSQL is a stand-alone and lightweight library with no dependencies and can be used in any PHP project, big or small.
:::{figure} ../../images/agiletoolkit.png :alt: Agile Toolkit Stack :::
DSQL is also a part of Agile Toolkit framework and works best with Agile Models. Your project may benefit from a higher-level data abstraction layer, so be sure to look at the rest of the suite.
How can I help you explore Laravel packages today?