Download the PHP package eltaline/bulk without Composer

On this page you can find all versions of the php package eltaline/bulk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bulk

PDO Bulk Library PDO Bulk Library

Tools for easy use bulk/batch inserts with support ON CONFLICT/ON DUPLICATE KEY/DO NOTHING/INSERT IGNORE, RETURNING sql operators and simple math/concatenation logic.

Contains helper classes for interacting with databases.

Currently supported PDO Postgresql/MySQL.

Installation

Install from composer:

Or install by local file:

Requirements

This library requires PHP 7.1 or later.

Package overview

This package contains several helpers:

PgSQL: PSLIns, PSLInsNth, PSLInsUpd, PSLDel. MySQL: MSLIns, MSLInsNth, MSLInsUpd, MSLDel.

These classes built on top of PDO, allow you to speed up database rows insertion & deletion by performing multiple(bulk) operations per query, with this API.

Testing table scheme

Create table for testing in PostgreSQL/MySQL.

Description important fucntions

Flush function is important, and need to be used everywhere at the end of work with queue. Do write last queue buffer and reset queue buffer.

Queue functions queue() or queuearray() can be used only separately in one loop.

Description optional functions

Can use optional counters in logic.

Reset function for buffer and counters, do reset queue buffer and counters.

PSLIns & MSLIns

This class takes advantage of the bulk insert to empty/temp tables.

To use it, create a PSLIns or MSLIns instance with:

PSLInsNth & MSLInsNth

This class takes advantage of the bulk insert without duplicate key errors in tables.

To use it, create a PSLInsNth or MSLInsNth instance with:

PSLInsUpd & MSLInsUpd

This class takes advantage of the bulk insert with simple math logic in tables.

To use it, create a PSLInsUpd or MSLInsUpd instance with:

PSLDel & MSLDel

This class takes advantage of the bulk delete by value`s of column or columns.

To use it, create a PSLDel or MSLDel instance with:

Beginning

Transactions

You can also use transaction for speed up bulk query.

Additionally use try with catch (Exception $e) for rollback transaction.

Simple Operations

Supported in next classes:

PgSQL: PSLIns, PSLInsNth, PSLInsUpd, PSLDel. MySQL: MSLIns, PSLInsNth, MSLInsUpd, MSLDel.

Format: (connection object, queue size, table, [values columns])

Format: (connection object, queue size, table, [values columns])

Format: (connection object, queue size, table, [values columns], [conflict/duplicate columns], [update columns])

Format: (connection object, queue size, table, [values columns])

Full example:

Advanced Operations

Supported in next classes:

PgSQL: PSLInsUpd. MySQL: MSLInsUpd.

Format: (connection object, queue size, table, [values columns], [conflict/duplicate columns], [update columns])

Full example:

Returning Operations

Supported in next classes:

PgSQL: PSLIns, PSLInsNth, PSLInsUpd, PSLDel. MySQL: MSLIns, MSLInsNth, MSLInsUpd, MSLDel.

Use one of supported class with RETURNING operator.

Supported fetch modes:

Format: (connection object, queue size, table, [values columns], [not used], [not used], [returning columns], [fetch mode])

Format: (connection object, queue size, table, [values columns], [not used], [not used], [returning columns], [fetch mode])

Format: (connection object, queue size, table, [values columns], [conflict/duplicate columns], [update columns], [returning columns], [fetch mode])

Format: (connection object, queue size, table, [values columns], [not using now], [not using now], [returning columns], [fetch mode])

Full example:

RAW Sql

For setting columns in RAW Sql format, You need add suffix :IS_RAW in column names. Example:

Performance tips

To get the maximum performance out of this library, you should:

These two tips combined can get you up to 50% more throughput in terms of inserts per second.

Recommendations

When using transactions, I recommend not forget use over this helpers - try and catch with throw and .

Limitations

Be careful when raising the number of operations per bulk query, as you might hit these limits.

$ins = new PSL...($pdo, 1000, 'tablename', ['columnname']);

Recommended use this library with 100-1000 queries per bulk query insertions.

Maximum 65535 query parameters is allowed. Ex. 65535 / 10 columns ~= 10922 (is max queries per 1 bulk query).

END


All versions of bulk with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eltaline/bulk contains the following files

Loading the files please wait ....