diff --git a/classes/db_pdo.php b/classes/db_pdo.php index f8a1aaa..037419a 100644 --- a/classes/db_pdo.php +++ b/classes/db_pdo.php @@ -538,5 +538,44 @@ abstract class DB_PDO extends PDO { * @return void */ abstract public function truncate($table); + + // -------------------------------------------------------------------------- + + /** + * Create sql for batch insert + * + * @param string $table + * @param array $data + * @return string + */ + public function insert_batch($table, $data=array()) + { + if ( ! is_array($data[0])) return NULL; + + $table = $this->quote_table($table); + $fields = array_keys($data[0]); + $vals = array(); + + $sql = "INSERT INTO {$table} ("; + $sql .= implode(',', $this->quote_ident($fields)); + $sql .= ") VALUES "; + + $params = array_fill(0, count($fields), '?'); + $param_string = implode(',', $params); + + // Remove the first array after use, as it is a special case + $sql .= "({$param_string})"; + $vals = array_values($data[0]); + array_shift($data); + + // Add another grouping for each + foreach($data as $group) + { + $sql .= ",({$param_string})"; + $vals = array_merge($vals, array_values($group)); + } + + return array($sql, $vals); + } } // End of db_pdo.php \ No newline at end of file diff --git a/classes/query_builder.php b/classes/query_builder.php index 735d0da..ee352fc 100644 --- a/classes/query_builder.php +++ b/classes/query_builder.php @@ -1016,6 +1016,28 @@ class Query_Builder implements iQuery_Builder { return $this->_run("insert", $table); } + + // -------------------------------------------------------------------------- + + /** + * Create sql for batch insert + * + * @param string $table + * @param array $data + * @return string + */ + public function insert_batch($table, $data=array()) + { + // Get the generated values and sql string + list($sql, $data) = $this->db->insert_batch($table, $data); + + if ( ! is_null($sql)) + { + return $this->_run('', $table, FALSE, $sql, $data); + } + + return NULL; + } // -------------------------------------------------------------------------- @@ -1185,13 +1207,22 @@ class Query_Builder implements iQuery_Builder { * @param string $type * @param string $table * @param bool $simple + * @param string $sql + * @param mixed $vals * @return mixed */ - protected function _run($type, $table, $simple=FALSE) + protected function _run($type, $table, $simple=FALSE, $sql=NULL, $vals=NULL) { - $sql = $this->_compile($type, $table); - $vals = array_merge($this->values, (array) $this->where_values); - + if (is_null($sql)) + { + $sql = $this->_compile($type, $table); + } + + if (is_null($vals)) + { + $vals = array_merge($this->values, (array) $this->where_values); + } + // Add quotes to 'string' values foreach($vals as &$v) { diff --git a/docs/classes/BadConnectionException.html b/docs/classes/BadConnectionException.html index b7abc69..1fc90b7 100644 --- a/docs/classes/BadConnectionException.html +++ b/docs/classes/BadConnectionException.html @@ -219,7 +219,7 @@
+ generated on 2013-05-03T13:07:08-04:00.
diff --git a/docs/classes/BadDBDriverException.html b/docs/classes/BadDBDriverException.html index 09bae6c..99bdbe1 100644 --- a/docs/classes/BadDBDriverException.html +++ b/docs/classes/BadDBDriverException.html @@ -219,7 +219,7 @@
+ generated on 2013-05-03T13:07:08-04:00.
diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index 3d3ea1d..f22b623 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -99,6 +99,7 @@ the connection/database
get_system_tables()
  • Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Return the number of rows returned for a SELECT query
    num_rows()
  • @@ -494,6 +495,25 @@ the connection/database +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    +
    +

    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -743,7 +763,7 @@ the connection/database
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index 1becc56..952a6ac 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -210,7 +210,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index 4de197b..95ad9bc 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -95,6 +95,7 @@ the connection/database
    get_system_tables()
  • Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Return the number of rows returned for a SELECT query
    num_rows()
  • @@ -575,6 +576,25 @@ the connection/database +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    +
    +

    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -925,7 +945,7 @@ the last query executed
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index 7139097..2265ca8 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -505,7 +505,7 @@ the query
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index 5c9c204..1588d8f 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -234,7 +234,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index 777dd4c..bd77804 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -213,7 +213,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/MySQL.html b/docs/classes/MySQL.html index bb95ad8..62ba246 100644 --- a/docs/classes/MySQL.html +++ b/docs/classes/MySQL.html @@ -99,6 +99,7 @@ the connection/database
    get_system_tables()
  • Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Return the number of rows returned for a SELECT query
    num_rows()
  • @@ -618,6 +619,29 @@ the connection/database +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::insert_batch()
    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -963,7 +987,7 @@ the connection/database
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/MySQL_SQL.html b/docs/classes/MySQL_SQL.html index 9519292..23b9962 100644 --- a/docs/classes/MySQL_SQL.html +++ b/docs/classes/MySQL_SQL.html @@ -239,7 +239,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/MySQL_Util.html b/docs/classes/MySQL_Util.html index e5d4d7c..52a563b 100644 --- a/docs/classes/MySQL_Util.html +++ b/docs/classes/MySQL_Util.html @@ -209,7 +209,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/ODBC.html b/docs/classes/ODBC.html index 6365cad..73369f2 100644 --- a/docs/classes/ODBC.html +++ b/docs/classes/ODBC.html @@ -99,6 +99,7 @@ the connection/database
    get_system_tables()
  • Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Return the number of rows returned for a SELECT query
    num_rows()
  • @@ -618,6 +619,25 @@ the connection/database +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    +
    +

    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -963,7 +983,7 @@ the connection/database
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/ODBC_SQL.html b/docs/classes/ODBC_SQL.html index 321297f..ba1a52e 100644 --- a/docs/classes/ODBC_SQL.html +++ b/docs/classes/ODBC_SQL.html @@ -234,7 +234,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/ODBC_Util.html b/docs/classes/ODBC_Util.html index d3af245..e5f3b9c 100644 --- a/docs/classes/ODBC_Util.html +++ b/docs/classes/ODBC_Util.html @@ -204,7 +204,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/PgSQL.html b/docs/classes/PgSQL.html index 6756a67..21b0e51 100644 --- a/docs/classes/PgSQL.html +++ b/docs/classes/PgSQL.html @@ -99,6 +99,7 @@ the connection/database
    get_system_tables()
  • Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Return the number of rows returned for a SELECT query
    num_rows()
  • @@ -614,6 +615,29 @@ the connection/database +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    Inherited
    +
    +

    + + + +
    inherited_from\DB_PDO::insert_batch()
    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -965,7 +989,7 @@ the connection/database
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/PgSQL_SQL.html b/docs/classes/PgSQL_SQL.html index f7a759b..f990ea2 100644 --- a/docs/classes/PgSQL_SQL.html +++ b/docs/classes/PgSQL_SQL.html @@ -234,7 +234,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/PgSQL_Util.html b/docs/classes/PgSQL_Util.html index b81e2c5..78bdd7b 100644 --- a/docs/classes/PgSQL_Util.html +++ b/docs/classes/PgSQL_Util.html @@ -209,7 +209,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Query_Builder.html b/docs/classes/Query_Builder.html index 2219a4a..04ac3a3 100644 --- a/docs/classes/Query_Builder.html +++ b/docs/classes/Query_Builder.html @@ -80,6 +80,7 @@ execute current compiled query
    get()
  • Adds a paren to the current query for query grouping
    group_start()
  • Generates a 'Having' clause
    having()
  • Creates an insert clause, and executes it
    insert()
  • +
  • Create sql for batch insert
    insert_batch()
  • Creates a join phrase in a compiled query
    join()
  • Creates a Like clause in the sql statement
    like()
  • Set a limit on the current sql statement
    limit()
  • @@ -499,6 +500,25 @@ execute current compiled query
    mixed
    +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    +
    +

    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    Creates a join phrase in a compiled query

    join(string $table, string $condition, string $type) : \Query_Builder
    @@ -1135,7 +1155,7 @@ passed array with key / value pairs

    Executes the compiled query

    -
    _run(string $type, string $table, bool $simple) : mixed
    +
    _run(string $type, string $table, bool $simple, string $sql, mixed $vals) : mixed

    @@ -1152,6 +1172,14 @@ passed array with key / value pairs

    $simple

    bool
    +
    +

    $sql

    +string +
    +
    +

    $vals

    +mixed +

    Returns

    mixed
    @@ -1361,7 +1389,7 @@ passed array with key / value pairs
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/Query_Parser.html b/docs/classes/Query_Parser.html index db9a6e5..48769bd 100644 --- a/docs/classes/Query_Parser.html +++ b/docs/classes/Query_Parser.html @@ -145,7 +145,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/SQLite.html b/docs/classes/SQLite.html index 39bc6c7..6f44057 100644 --- a/docs/classes/SQLite.html +++ b/docs/classes/SQLite.html @@ -97,6 +97,7 @@ method if the database does not support 'TRUNCATE';
    empty_table()Return list of views for the current database
    get_views()
  • inTransaction()
    inTransaction()
  • +
  • Create sql for batch insert
    insert_batch()
  • lastInsertId()
    lastInsertId()
  • Load a database for the current connection
    load_database()
  • @@ -605,6 +606,25 @@ method if the database does not support 'TRUNCATE'; +
    +

    Create sql for batch insert

    +
    insert_batch(string $table, array $data) : string
    +
    +
    +

    +

    Parameters

    +
    +

    $table

    +string +
    +
    +

    $data

    +array +
    +

    Returns

    +
    string
    +
    +

    lastInsertId()

    @@ -980,7 +1000,7 @@ method if the database does not support 'TRUNCATE';
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/SQLite_SQL.html b/docs/classes/SQLite_SQL.html index 83962d4..9572143 100644 --- a/docs/classes/SQLite_SQL.html +++ b/docs/classes/SQLite_SQL.html @@ -234,7 +234,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/SQLite_Util.html b/docs/classes/SQLite_Util.html index 6733ec2..27a4040 100644 --- a/docs/classes/SQLite_Util.html +++ b/docs/classes/SQLite_Util.html @@ -209,7 +209,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/iDB_SQL.html b/docs/classes/iDB_SQL.html index 505e278..b072dc9 100644 --- a/docs/classes/iDB_SQL.html +++ b/docs/classes/iDB_SQL.html @@ -244,7 +244,7 @@ specified table
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/classes/iQuery_Builder.html b/docs/classes/iQuery_Builder.html index db86fb4..2a8b182 100644 --- a/docs/classes/iQuery_Builder.html +++ b/docs/classes/iQuery_Builder.html @@ -964,7 +964,7 @@ passed array with key / value pairs
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/deprecated.html b/docs/deprecated.html index 7fcbe86..db68b0c 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -68,7 +68,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/errors.html b/docs/errors.html index 82de262..494be8e 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -237,7 +237,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/graph_class.html b/docs/graph_class.html index 7b949bd..96b51e0 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -65,7 +65,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/markers.html b/docs/markers.html index f9463ea..0018d1d 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -110,7 +110,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 90a0784..f0f5cc2 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -340,7 +340,7 @@ instantiates the specific db driver

    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/packages/.html b/docs/packages/.html index 6eeef33..3c74093 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -68,7 +68,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/packages/Default.html b/docs/packages/Default.html index a227b0f..06614fe 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -95,7 +95,7 @@
    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index 9009e42..883fe8f 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -212,7 +212,7 @@ data-fetching methods

    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index 27374c1..df4ec2e 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -150,7 +150,7 @@ instantiates the specific db driver

    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/packages/Query.html b/docs/packages/Query.html index 88fd9ca..37c59ef 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -362,7 +362,7 @@ instantiates the specific db driver

    + generated on 2013-05-03T13:07:08-04:00.
    diff --git a/docs/structure.xml b/docs/structure.xml index bafed20..60defa0 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -98,7 +98,7 @@ - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -577,9 +577,36 @@ the connection/database]]> + + insert_batch + function + + + + + string + + + array + + + string + + + + $table + + + + + $data + + + +
    - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -1766,19 +1793,19 @@ in place of the get() method]]> - update + insert_batch function - + string - - mixed + + array - - mixed + + string @@ -1792,267 +1819,310 @@ in place of the get() method]]> - - delete + + update function - - + + - + string - + mixed - + mixed - + $table - + + $data + + + + + + delete + function + + + + + string + + + mixed + + + mixed + + + + $table + + + + $where - + get_compiled_select function - + - + string - + bool - + string - + $table - + $reset - + get_compiled_insert function - + - + string - + bool - + string - + $table - + $reset - + get_compiled_update function - + - + string - + bool - + string - + $table - + $reset - + get_compiled_delete function - + - + string - + bool - + string - + $table - + $reset - + _get_compile function - + - + string - + string - - + + - + $type - + $table - + $reset - + reset_query function - + - + void - + _run function - + - + string - + string - + bool - + + string + + + mixed + + mixed - + $type - + $table - + $simple + + $sql + + + + + $vals + + + - + __call function - + - + string - + array - + mixed - + $name - + $params - + _compile function - + - + string - + string - + \$string - + $type - + $table @@ -4324,7 +4394,7 @@ with array_map and glob]]>
    - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -4411,6 +4481,33 @@ with array_map and glob]]> + + insert_batch + function + + + + + string + + + array + + + string + + + + $table + + + + + $data + + + +
    @@ -4963,7 +5060,7 @@ with array_map and glob]]> - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -5104,6 +5201,33 @@ with array_map and glob]]> + + insert_batch + function + + + + + string + + + array + + + string + + + + $table + + + + + $data + + + +
    @@ -5856,7 +5980,7 @@ the query]]> - + Free Query Builder / Database Abstraction Layer

    ]]>
    @@ -6151,6 +6275,33 @@ the last query executed]]> + + insert_batch + function + + + + + string + + + array + + + string + + + + $table + + + + + $data + + + +
    diff --git a/drivers/firebird/firebird_driver.php b/drivers/firebird/firebird_driver.php index 42c13f3..d12cdc7 100644 --- a/drivers/firebird/firebird_driver.php +++ b/drivers/firebird/firebird_driver.php @@ -268,5 +268,20 @@ class Firebird extends DB_PDO { // the firebird database return NULL; } + + // -------------------------------------------------------------------------- + + /** + * Create sql for batch insert + * + * @param string $table + * @param array $data + * @return string + */ + public function insert_batch($table, $data=array()) + { + // This is not very applicable to the firebird database + return NULL; + } } // End of firebird_driver.php \ No newline at end of file diff --git a/drivers/odbc/odbc_driver.php b/drivers/odbc/odbc_driver.php index cd96c0a..fabe90f 100644 --- a/drivers/odbc/odbc_driver.php +++ b/drivers/odbc/odbc_driver.php @@ -54,5 +54,20 @@ class ODBC extends DB_PDO { $sql = "DELETE FROM {$table}"; $this->query($sql); } + + // -------------------------------------------------------------------------- + + /** + * Create sql for batch insert + * + * @param string $table + * @param array $data + * @return string + */ + public function insert_batch($table, $data=array()) + { + // This is not very applicable to the firebird database + return NULL; + } } // End of odbc_driver.php \ No newline at end of file diff --git a/drivers/sqlite/sqlite_driver.php b/drivers/sqlite/sqlite_driver.php index 29e8e78..437aee5 100644 --- a/drivers/sqlite/sqlite_driver.php +++ b/drivers/sqlite/sqlite_driver.php @@ -125,5 +125,20 @@ SQL; $this->statement->execute(); } + + // -------------------------------------------------------------------------- + + /** + * Create sql for batch insert + * + * @param string $table + * @param array $data + * @return string + */ + public function insert_batch($table, $data=array()) + { + // This is not very applicable to the firebird database + return NULL; + } } //End of sqlite_driver.php \ No newline at end of file diff --git a/tests/core/db_qb_test.php b/tests/core/db_qb_test.php index 750df45..00d7395 100644 --- a/tests/core/db_qb_test.php +++ b/tests/core/db_qb_test.php @@ -456,6 +456,35 @@ abstract class QBTest extends UnitTestCase { $this->assertIsA($query, 'PDOStatement'); } + + // -------------------------------------------------------------------------- + + public function TestInsertBatch() + { + if (empty($this->db)) return; + + $data = array( + array( + 'id' => 544, + 'key' => 3, + 'val' => 7, + ), + array( + 'id' => 89, + 'key' => 34, + 'val' => 57, + ), + array( + 'id' => 48, + 'key' => 403, + 'val' => 97, + ), + ); + + $query = $this->db->insert_batch('test', $data); + + $this->assertIsA($query, 'PDOStatement'); + } // -------------------------------------------------------------------------- diff --git a/tests/databases/firebird/firebird-qb.php b/tests/databases/firebird/firebird-qb.php index 5497d9c..49676bc 100644 --- a/tests/databases/firebird/firebird-qb.php +++ b/tests/databases/firebird/firebird-qb.php @@ -65,6 +65,8 @@ class FirebirdQBTest extends QBTest { $this->assertNull($query); } + + // -------------------------------------------------------------------------- public function TestTypeList() { diff --git a/tests/databases/sqlite/sqlite-qb.php b/tests/databases/sqlite/sqlite-qb.php index b50e258..4f69c17 100644 --- a/tests/databases/sqlite/sqlite-qb.php +++ b/tests/databases/sqlite/sqlite-qb.php @@ -31,4 +31,33 @@ // echo '
    SQLite Queries
    '; } + + // -------------------------------------------------------------------------- + + public function TestInsertBatch() + { + if (empty($this->db)) return; + + $insert_array = array( + array( + 'id' => 6, + 'key' => 2, + 'val' => 3 + ), + array( + 'id' => 5, + 'key' => 6, + 'val' => 7 + ), + array( + 'id' => 8, + 'key' => 1, + 'val' => 2 + ) + ); + + $query = $this->db->insert_batch('test', $insert_array); + + $this->assertNull($query); + } } \ No newline at end of file diff --git a/tests/db_files/FB_TEST_DB.FDB b/tests/db_files/FB_TEST_DB.FDB index 2db3e91..8ff1087 100755 Binary files a/tests/db_files/FB_TEST_DB.FDB and b/tests/db_files/FB_TEST_DB.FDB differ