ntentan / atiaa
A slim wrapper around PDO to provide some extra utilities
v0.10.0
2026-08-27 03:34 UTC
Requires
- ext-pdo: *
- ntentan/utils: 0.*
Requires (Dev)
- ext-json: *
- phpunit/phpunit: 11.*
README
Atiaa is a thin wrapper around PHP's PDO database abstraction layer. The main purpose of atiaa is to provide utility classes that other packages in the ntentan framework need (which are not available in PDO).
Currently atiaa provides the following features:
- Wrappers arround the PDO query method which prepare the query and execute in one stretch. These methods then return all the results as a simple PHP associative array.
- Methods which describe the schema of the database represented by the connection.
- A platform independent approach for quoting database literals in queries.
Currently atiaa works only with MySQL, PostgreSQL and SQLite databases. Support for other platforms is planned for later releases.
Installation
The best way to install atiaa is to use composer. To install atiaa add
ntentan/atiaa to your composer dependencies.
Example
The following example tries to summarise the entirety of atiaa.
<?php // Connect to a database $factory = new \ntentan\atiaa\DefaultDriverFactory( [ 'driver' => 'mysql', 'user' => 'root', 'password' => 'rootpassy', 'host' => 'localhost', 'dbname' => 'somedb' ] ); $atiaa = $factory->createDriver(); // Perform some queries $data = $atiaa->query('SELECT * FROM some_table'); $data2 = $atiaa->query( 'SELECT * FROM some_other_table WHERE id = ? and an_item = ?', [2, 'something'] ); // Get the description of the database $description = $atiaa->describe(); var_dump($description); // Perform a query while quoting the literals. $data3 = $atiaa->quoteQuery('SELECT "First Name" from "Users Table" ');