Download the PHP package flyokai/zend-db-sql-insertmultiple without Composer
On this page you can find all versions of the php package flyokai/zend-db-sql-insertmultiple. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package zend-db-sql-insertmultiple
flyokai/zend-db-sql-insertmultiple
User docs →
AGENTS.mdMulti-row
INSERT INTO … VALUES (…), (…), (…)for Laminas DB.
Adds Laminas\Db\Sql\InsertMultiple, a single-statement multi-row insert builder that is otherwise missing from Laminas DB. Adapted from the original Zend\Db\Sql\Insert.
Features
- Multi-row
INSERT … VALUES (…), (…), (…) INSERT … SELECT- Two value-merging strategies:
VALUES_SET(replace) andVALUES_MERGE(append) - Compatible with Laminas
Sql::buildSqlString()/Sql::prepareStatementForSqlObject()
Installation
Quick start
Multi-row insert
INSERT … SELECT
Value merging
API
| Method | Purpose |
|---|---|
into(string $table) |
Set target table |
columns(array $columns) |
Define column list (call before values()) |
values(array\|Select $values, int $flag = VALUES_SET) |
Set/append rows or provide a Select |
select(Select $select) |
Convenience for INSERT…SELECT |
getRawState($key) |
Introspect internal state (for debugging) |
Internals
- Each row is
ksort()-ed for consistent column ordering. - Named parameters are generated as
insMulti0,insMulti1, … - Non-scalar values (Expressions, Literals) are cached per column to avoid redundant SQL generation.
Gotchas
columns()is required beforevalues()with array data. Missing columns throwsInvalidArgumentException.- No built-in chunking — generates a single statement for all rows. MySQL has statement size limits (~1000 tuples by default). Calling code must chunk.
- Empty values produce empty SQL — if no rows,
processInsert()returns an empty string silently. - Cannot mix
VALUES_MERGEwith aSelect— throws. - Parameter naming is global — counter is shared across all rows (
insMulti0,insMulti1, …).
See also
flyokai/laminas-db-bulk-update—InsertOnDuplicateextendsInsertMultiplewith upsert behaviour and ID resolutionflyokai/laminas-db— base abstraction
License
BSD-3-Clause
All versions of zend-db-sql-insertmultiple with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.23
laminas/laminas-db Version ~2.5
laminas/laminas-stdlib Version ^2.5 || ^3.0
laminas/laminas-db Version ~2.5
laminas/laminas-stdlib Version ^2.5 || ^3.0
The package flyokai/zend-db-sql-insertmultiple contains the following files
Loading the files please wait ...