Download the PHP package commandstring/pdo without Composer
On this page you can find all versions of the php package commandstring/pdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download commandstring/pdo
More information about commandstring/pdo
Files in commandstring/pdo
Package pdo
Short Description A PDO driver with additional features
License MIT
Informations about the package pdo
This has been moved to TNAPF and updates will no longer be made here
CommandString/Pdo
Making PDO easier with the power of magic
Installation
composer require commandstring/pdo
Creating a connection
Doing so manually
You can use Driver::setDsnProp or Driver::with{insert dsn prop name here} to set additional dsn values
Using the database predefined createDriver method
I currently only have mysql and postgres specific methods
Executing a query
The driver will store the PDOStatement internally and detect if the method your invoking exists in PDOStatement or PDO and invoke it on one of the instances accordinly. Thankfully there's no method names that are the same between the two classes
Preparing a statement
Singleton Constructor Argument
If you construct a Driver with the singleton argument as true then that new instance will be stored as a static property in the class that can be called from anywhere with the get method. You can additionally call PDO/PDOStatement methods statically from Driver and it will work similar to $driver->methodName
Building Statements
Select
Insert
Update
Delete
Using where method
Creating Storable Statements
Create storableStatement instance
Create statement to be stored
Set before handler (optional)
The first argument is the statement passed into the setStatement method. You can define arguments that can be set when executing the statement more on that later.