Download the PHP package jarjak/dbal-manager without Composer
On this page you can find all versions of the php package jarjak/dbal-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jarjak/dbal-manager
More information about jarjak/dbal-manager
Files in jarjak/dbal-manager
Package dbal-manager
Short Description Doctrine DBAL helper for bulk data imports in MySQL and other stuff.
License MIT
Homepage https://github.com/JarJak/DBALManager
Informations about the package dbal-manager
DBALManager
Set of helper classes for Doctrine DBAL. It has been made maily to ease creating bulk imports. It provides a method to execute INSERT ... ON DUPLICATE KEY UPDATE
query on MySQL-compatible databases, which is what I miss in Doctrine's MySQL driver.
Symfony installation
To use this class in Symfony 2/3, please look at DBALManagerBundle.
In Symfony 4, thanks to autowiring you are not forced to use a bundle, just add these lines in your services.yaml
:
Integration with other frameworks
Run:
The class is PSR-0/PSR-4 compatible, so it can be integrated easily with any modern framework. Here is an example for Silex:
Simple example:
You want to insert data or update them if row already exists.
Or you want to just skip this row if it exists:
Advanced example:
Lets say we have user table with:
- unique usernames and emails
- column active can contain only 0 or 1 (not nullable)
- column address can be null
Dumping Queries
DBALManager can use VarDumper to dump SQL queries from QueryBuilder ready to be copypasted into database server (with parameters already included).
If you don't use QueryBuilder you can still dump parametrized SQL with:
Testing
Run tests with:
Fix code style with: