{"repo":"brick/db","free":true,"listed":false,"github":"https://github.com/brick/db","clone":"git clone https://github.com/brick/db.git","description":"Helper tools for interacting with databases","language":"PHP","stars":68,"topics":["php","database","bulk-inserts"],"license":"MIT","category":"databases-storage","readme_excerpt":"Brick\\Db ======== A collection of helper tools for interacting with databases. Installation ------------ This library is installable via Composer: Requirements ------------ This library requires PHP 8.1 or later. For PHP 7.4 and 8.0 compatibility, you can use version 0.2 . PHP 7.1, 7.2 & 7.3, you can use version 0.1 . Note that these PHP versions are EOL and not supported anymore. If you're still using one of these PHP versions, you should consider upgrading as soon as possible. Package overview ---------------- This package contains two helpers: BulkInserter and BulkDeleter . These classes, built on top of PDO , allow you to speed up database rows insertion & deletion by performing multiple operations per query, with a clean OO API. BulkInserter This class takes advantage of the extended insert / multirow syntax available in MySQL, PostgreSQL and SQLite. It basically replaces the need to send a batch of queries: with a single, faster query: To use it, create a BulkInserter instance with: - your PDO connection object - the name of your table - the name of the columns to insert - the number of inserts to perform per query (optional, defaults to 100) Example The queue() method does not do anything until either flush() is called, or the number of inserts per query is reached. Note: queue() returns false when the insert has been queued only, and true when the number of inserts per query has been reached and the batch has therefore been flushed to the database. This can be useful ","default_branch":null,"files":null,"tree":[],"storefront":"/r/brick","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/brick/db/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}